@@ -43,15 +43,15 @@ public function testBuildUrlArticleApi()
43
43
{
44
44
$ api = $ this ->diffbot ->createArticleAPI ('crawl ' )->setDiscussion (false );
45
45
46
- $ expected = 'https://api.diffbot.com/v3/crawl?token=demo&name=sitepoint_01&seeds=http%3A%2F%2Fsitepoint.com&apiUrl=https%3A%2F%2Fapi.diffbot.com%2Fv3%2Farticle%3F%26discussion%3Dfalse ' ;
46
+ $ expected = 'https://api.diffbot.com/v3/crawl?token=demo&name=sitepoint_01&seeds=http%3A%2F%2Fsitepoint.com&apiUrl=https%3A%2F%2Fapi.diffbot.com%2Fv3%2Farticle%3F%26timeout%3D30000% 26discussion%3Dfalse ' ;
47
47
$ c = $ this ->diffbot ->crawl ('sitepoint_01 ' , $ api );
48
48
$ c ->setSeeds (['http://sitepoint.com ' ]);
49
49
$ this ->assertEquals ($ expected , $ c ->buildUrl ());
50
50
}
51
51
52
52
public function testBuildUrlDefaultApi ()
53
53
{
54
- $ expected = 'https://api.diffbot.com/v3/crawl?token=demo&name=sitepoint_01&seeds=http%3A%2F%2Fsitepoint.com&apiUrl=https%3A%2F%2Fapi.diffbot.com%2Fv3%2Fanalyze%3F%26mode%3Dauto ' ;
54
+ $ expected = 'https://api.diffbot.com/v3/crawl?token=demo&name=sitepoint_01&seeds=http%3A%2F%2Fsitepoint.com&apiUrl=https%3A%2F%2Fapi.diffbot.com%2Fv3%2Fanalyze%3F%26timeout%3D30000% 26mode%3Dauto ' ;
55
55
$ c = $ this ->diffbot ->crawl ('sitepoint_01 ' );
56
56
$ c ->setSeeds (['http://sitepoint.com ' ]);
57
57
$ this ->assertEquals ($ expected , $ c ->buildUrl ());
@@ -67,7 +67,7 @@ public function testInvalidSeeds()
67
67
68
68
public function testPatternSetters ()
69
69
{
70
- $ expected = 'https://api.diffbot.com/v3/crawl?token=demo&name=sitepoint_01&seeds=http%3A%2F%2Fsitepoint.com&pageProcessPattern=class%3DarticleBody&urlCrawlPattern=%2Fcategory%2Fshoes||%21%2Fauthor%2F||%5Ehttp%3A%2F%2Fwww.diffbot.com||type%3Dproduct%24&urlProcessPattern=%2Fproduct%2Fdetail||%21%3Fcurrency%3Deuro&apiUrl=https%3A%2F%2Fapi.diffbot.com%2Fv3%2Fanalyze%3F%26mode%3Dauto ' ;
70
+ $ expected = 'https://api.diffbot.com/v3/crawl?token=demo&name=sitepoint_01&seeds=http%3A%2F%2Fsitepoint.com&pageProcessPattern=class%3DarticleBody&urlCrawlPattern=%2Fcategory%2Fshoes||%21%2Fauthor%2F||%5Ehttp%3A%2F%2Fwww.diffbot.com||type%3Dproduct%24&urlProcessPattern=%2Fproduct%2Fdetail||%21%3Fcurrency%3Deuro&apiUrl=https%3A%2F%2Fapi.diffbot.com%2Fv3%2Fanalyze%3F%26timeout%3D30000% 26mode%3Dauto ' ;
71
71
$ c = $ this ->diffbot ->crawl ('sitepoint_01 ' );
72
72
$ c ->setSeeds (['http://sitepoint.com ' ]);
73
73
@@ -85,7 +85,7 @@ public function testPatternSetters()
85
85
86
86
public function testRegexSetters ()
87
87
{
88
- $ expected = 'https://api.diffbot.com/v3/crawl?token=demo&name=sitepoint_01&seeds=http%3A%2F%2Fsitepoint.com&urlCrawlRegEx=/^[a-z0-9_-]{3,16}$/&urlProcessRegEx=/^#?([a-f0-9]{6}|[a-f0-9]{3})$/&apiUrl=https%3A%2F%2Fapi.diffbot.com%2Fv3%2Fanalyze%3F%26mode%3Dauto ' ;
88
+ $ expected = 'https://api.diffbot.com/v3/crawl?token=demo&name=sitepoint_01&seeds=http%3A%2F%2Fsitepoint.com&urlCrawlRegEx=/^[a-z0-9_-]{3,16}$/&urlProcessRegEx=/^#?([a-f0-9]{6}|[a-f0-9]{3})$/&apiUrl=https%3A%2F%2Fapi.diffbot.com%2Fv3%2Fanalyze%3F%26timeout%3D30000% 26mode%3Dauto ' ;
89
89
$ c = $ this ->diffbot ->crawl ('sitepoint_01 ' );
90
90
$ c ->setSeeds (['http://sitepoint.com ' ]);
91
91
@@ -114,7 +114,7 @@ public function maxHopsProvider()
114
114
*/
115
115
public function testMaxHops ($ input , $ urlFragment )
116
116
{
117
- $ expected = 'https://api.diffbot.com/v3/crawl?token=demo&name=sitepoint_01&seeds=http%3A%2F%2Fsitepoint.com&maxHops= ' . $ urlFragment . '&apiUrl=https%3A%2F%2Fapi.diffbot.com%2Fv3%2Fanalyze%3F%26mode%3Dauto ' ;
117
+ $ expected = 'https://api.diffbot.com/v3/crawl?token=demo&name=sitepoint_01&seeds=http%3A%2F%2Fsitepoint.com&maxHops= ' . $ urlFragment . '&apiUrl=https%3A%2F%2Fapi.diffbot.com%2Fv3%2Fanalyze%3F%26timeout%3D30000% 26mode%3Dauto ' ;
118
118
$ c = $ this ->diffbot ->crawl ('sitepoint_01 ' );
119
119
$ c ->setSeeds (['http://sitepoint.com ' ]);
120
120
@@ -142,7 +142,7 @@ public function maxProvider()
142
142
*/
143
143
public function testMax ($ input , $ urlFragment )
144
144
{
145
- $ expected = 'https://api.diffbot.com/v3/crawl?token=demo&name=sitepoint_01&seeds=http%3A%2F%2Fsitepoint.com&maxToCrawl= ' . $ urlFragment . '&maxToProcess= ' . $ urlFragment . '&apiUrl=https%3A%2F%2Fapi.diffbot.com%2Fv3%2Fanalyze%3F%26mode%3Dauto ' ;
145
+ $ expected = 'https://api.diffbot.com/v3/crawl?token=demo&name=sitepoint_01&seeds=http%3A%2F%2Fsitepoint.com&maxToCrawl= ' . $ urlFragment . '&maxToProcess= ' . $ urlFragment . '&apiUrl=https%3A%2F%2Fapi.diffbot.com%2Fv3%2Fanalyze%3F%26timeout%3D30000% 26mode%3Dauto ' ;
146
146
$ c = $ this ->diffbot ->crawl ('sitepoint_01 ' );
147
147
$ c ->setSeeds (['http://sitepoint.com ' ]);
148
148
@@ -177,7 +177,7 @@ public function notifyProviderOk()
177
177
*/
178
178
public function testNotify ($ input , $ urlFragment )
179
179
{
180
- $ expected = 'https://api.diffbot.com/v3/crawl?token=demo&name=sitepoint_01&seeds=http%3A%2F%2Fsitepoint.com& ' . $ urlFragment . '&apiUrl=https%3A%2F%2Fapi.diffbot.com%2Fv3%2Fanalyze%3F%26mode%3Dauto ' ;
180
+ $ expected = 'https://api.diffbot.com/v3/crawl?token=demo&name=sitepoint_01&seeds=http%3A%2F%2Fsitepoint.com& ' . $ urlFragment . '&apiUrl=https%3A%2F%2Fapi.diffbot.com%2Fv3%2Fanalyze%3F%26timeout%3D30000% 26mode%3Dauto ' ;
181
181
$ c = $ this ->diffbot ->crawl ('sitepoint_01 ' );
182
182
$ c ->setSeeds (['http://sitepoint.com ' ]);
183
183
@@ -230,7 +230,7 @@ public function crawlDelayProviderOk()
230
230
*/
231
231
public function testCrawlOk ($ input , $ urlFragment )
232
232
{
233
- $ expected = 'https://api.diffbot.com/v3/crawl?token=demo&name=sitepoint_01&seeds=http%3A%2F%2Fsitepoint.com&crawlDelay= ' . $ urlFragment . '&apiUrl=https%3A%2F%2Fapi.diffbot.com%2Fv3%2Fanalyze%3F%26mode%3Dauto ' ;
233
+ $ expected = 'https://api.diffbot.com/v3/crawl?token=demo&name=sitepoint_01&seeds=http%3A%2F%2Fsitepoint.com&crawlDelay= ' . $ urlFragment . '&apiUrl=https%3A%2F%2Fapi.diffbot.com%2Fv3%2Fanalyze%3F%26timeout%3D30000% 26mode%3Dauto ' ;
234
234
$ c = $ this ->diffbot ->crawl ('sitepoint_01 ' );
235
235
$ c ->setSeeds (['http://sitepoint.com ' ]);
236
236
@@ -280,7 +280,7 @@ public function repeatProviderOk()
280
280
*/
281
281
public function testRepeatOk ($ input , $ urlFragment )
282
282
{
283
- $ expected = 'https://api.diffbot.com/v3/crawl?token=demo&name=sitepoint_01&seeds=http%3A%2F%2Fsitepoint.com&repeat= ' . $ urlFragment . '&apiUrl=https%3A%2F%2Fapi.diffbot.com%2Fv3%2Fanalyze%3F%26mode%3Dauto ' ;
283
+ $ expected = 'https://api.diffbot.com/v3/crawl?token=demo&name=sitepoint_01&seeds=http%3A%2F%2Fsitepoint.com&repeat= ' . $ urlFragment . '&apiUrl=https%3A%2F%2Fapi.diffbot.com%2Fv3%2Fanalyze%3F%26timeout%3D30000% 26mode%3Dauto ' ;
284
284
$ c = $ this ->diffbot ->crawl ('sitepoint_01 ' );
285
285
$ c ->setSeeds (['http://sitepoint.com ' ]);
286
286
@@ -314,8 +314,8 @@ public function testRepeatNotOk($input)
314
314
315
315
public function testOnlyProcessIfNew ()
316
316
{
317
- $ expected1 = 'https://api.diffbot.com/v3/crawl?token=demo&name=sitepoint_01&seeds=http%3A%2F%2Fsitepoint.com&onlyProcessIfNew=1&apiUrl=https%3A%2F%2Fapi.diffbot.com%2Fv3%2Fanalyze%3F%26mode%3Dauto ' ;
318
- $ expected2 = 'https://api.diffbot.com/v3/crawl?token=demo&name=sitepoint_01&seeds=http%3A%2F%2Fsitepoint.com&onlyProcessIfNew=0&apiUrl=https%3A%2F%2Fapi.diffbot.com%2Fv3%2Fanalyze%3F%26mode%3Dauto ' ;
317
+ $ expected1 = 'https://api.diffbot.com/v3/crawl?token=demo&name=sitepoint_01&seeds=http%3A%2F%2Fsitepoint.com&onlyProcessIfNew=1&apiUrl=https%3A%2F%2Fapi.diffbot.com%2Fv3%2Fanalyze%3F%26timeout%3D30000% 26mode%3Dauto ' ;
318
+ $ expected2 = 'https://api.diffbot.com/v3/crawl?token=demo&name=sitepoint_01&seeds=http%3A%2F%2Fsitepoint.com&onlyProcessIfNew=0&apiUrl=https%3A%2F%2Fapi.diffbot.com%2Fv3%2Fanalyze%3F%26timeout%3D30000% 26mode%3Dauto ' ;
319
319
320
320
$ c = $ this ->diffbot ->crawl ('sitepoint_01 ' );
321
321
$ c ->setSeeds (['http://sitepoint.com ' ]);
@@ -345,7 +345,7 @@ public function maxRoundsProvider()
345
345
*/
346
346
public function testMaxRounds ($ input , $ urlFragment )
347
347
{
348
- $ expected = 'https://api.diffbot.com/v3/crawl?token=demo&name=sitepoint_01&seeds=http%3A%2F%2Fsitepoint.com&maxRounds= ' . $ urlFragment . '&apiUrl=https%3A%2F%2Fapi.diffbot.com%2Fv3%2Fanalyze%3F%26mode%3Dauto ' ;
348
+ $ expected = 'https://api.diffbot.com/v3/crawl?token=demo&name=sitepoint_01&seeds=http%3A%2F%2Fsitepoint.com&maxRounds= ' . $ urlFragment . '&apiUrl=https%3A%2F%2Fapi.diffbot.com%2Fv3%2Fanalyze%3F%26timeout%3D30000% 26mode%3Dauto ' ;
349
349
$ c = $ this ->diffbot ->crawl ('sitepoint_01 ' );
350
350
$ c ->setSeeds (['http://sitepoint.com ' ]);
351
351
@@ -356,8 +356,8 @@ public function testMaxRounds($input, $urlFragment)
356
356
357
357
public function testObeyRobots ()
358
358
{
359
- $ expected1 = 'https://api.diffbot.com/v3/crawl?token=demo&name=sitepoint_01&seeds=http%3A%2F%2Fsitepoint.com&obeyRobots=1&apiUrl=https%3A%2F%2Fapi.diffbot.com%2Fv3%2Fanalyze%3F%26mode%3Dauto ' ;
360
- $ expected2 = 'https://api.diffbot.com/v3/crawl?token=demo&name=sitepoint_01&seeds=http%3A%2F%2Fsitepoint.com&obeyRobots=0&apiUrl=https%3A%2F%2Fapi.diffbot.com%2Fv3%2Fanalyze%3F%26mode%3Dauto ' ;
359
+ $ expected1 = 'https://api.diffbot.com/v3/crawl?token=demo&name=sitepoint_01&seeds=http%3A%2F%2Fsitepoint.com&obeyRobots=1&apiUrl=https%3A%2F%2Fapi.diffbot.com%2Fv3%2Fanalyze%3F%26timeout%3D30000% 26mode%3Dauto ' ;
360
+ $ expected2 = 'https://api.diffbot.com/v3/crawl?token=demo&name=sitepoint_01&seeds=http%3A%2F%2Fsitepoint.com&obeyRobots=0&apiUrl=https%3A%2F%2Fapi.diffbot.com%2Fv3%2Fanalyze%3F%26timeout%3D30000% 26mode%3Dauto ' ;
361
361
$ c = $ this ->diffbot ->crawl ('sitepoint_01 ' );
362
362
$ c ->setSeeds (['http://sitepoint.com ' ]);
363
363
0 commit comments