public function test() { $parser = new Parser2GIS(getenv('SELENIUM_DRIVER_HOST'), getenv('DRIVER_BROWSER_NAME'), getenv('DRIVER_BROWSER_USER_AGENT')); $cities = $parser->getCities(); $this->assertGreaterThan(90, sizeof($cities)); $this->assertNotEmpty($cities[0]['name']); $this->assertNotEmpty($cities[0]['href']); $this->assertNotEmpty($cities[0]['id']); }
public function test() { $parser = new Parser2GIS(getenv('SELENIUM_DRIVER_HOST'), getenv('DRIVER_BROWSER_NAME'), getenv('DRIVER_BROWSER_USER_AGENT')); $rubrics = $parser->getRubrics('http://2gis.ru/yaroslavl'); $this->assertGreaterThan(10, sizeof($rubrics)); $this->assertNotEmpty($rubrics[0]['id']); $this->assertNotEmpty($rubrics[0]['name']); $this->assertNotEmpty($rubrics[0]['subRubrics']); $this->assertGreaterThan(1, sizeof($rubrics[0]['subRubrics'])); }
public function test() { $parser = new Parser2GIS(getenv('SELENIUM_DRIVER_HOST'), getenv('DRIVER_BROWSER_NAME'), getenv('DRIVER_BROWSER_USER_AGENT')); $cityHref = 'http://2gis.ru/yaroslavl'; $rubricName = 'Пожарная охрана'; $rubricId = '3940769933033615'; $organisations = $parser->getOrganisationsByRubric($cityHref, $rubricName, $rubricId); $this->assertGreaterThan(5, sizeof($organisations)); //Test solo category organisation $cityHref = 'http://2gis.ru/yaroslavl'; $rubricName = 'Справочно-информационные услуги'; $rubricId = '3940769933033623'; $organisations = $parser->getOrganisationsByRubric($cityHref, $rubricName, $rubricId); $this->assertEquals(1, sizeof($organisations)); }