public function getFromAutoRuWithoutCity(CrwlTester $I) { $query = $this->crwl->ads(); $ads = $query->source(Sources::AM_RU)->get(); $I->assertTrue(is_array($ads)); $I->assertNotEmpty($ads); }
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()); }
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); } }