示例#1
0
 public function getFromAutoRuWithoutCity(CrwlTester $I)
 {
     $query = $this->crwl->ads();
     $ads = $query->source(Sources::AM_RU)->get();
     $I->assertTrue(is_array($ads));
     $I->assertNotEmpty($ads);
 }
示例#2
0
 public function queryAdWithWrongApiKey(CrwlTester $I)
 {
     $apiKey = 'wrongApiKey';
     $crwl = new Crwl($apiKey);
     $query = $crwl->ad();
     $ads = $query->get();
     $I->assertFalse($ads);
     $I->assertEquals(400, $query->getErrorCode());
 }
示例#3
0
 public function dontExistsUrl(CrwlTester $I)
 {
     $ads = $this->crwl->ads()->region(Regions::MOSCOW)->source(Sources::AUTO_RU)->get();
     $I->assertNotEmpty($ads);
     foreach ($ads as $ad) {
         $car = $this->crwl->ad()->url($ad['url'] . 'test')->get();
         $I->assertFalse($car);
     }
 }