/** * @covers ::execute * * @dataProvider providerTestExecute * * @depends testExecute */ public function testExecuteRealRequest($form, $instanceof) { $this->sut = Countries::create($this->productionRequestHandler); $languageCodes = ['en']; $limit = mt_rand(1, 9); $countries = $this->sut->setLanguageCodes($languageCodes)->setForm($form)->setLimit($limit)->execute(); $this->assertInternalType('array', $countries); // If the request does not return any data, we cannot test its // integrity. $this->assertNotEmpty($countries); $this->assertTrue(count($countries) <= $limit); foreach ($countries as $city) { $this->assertInstanceOf($instanceof, $city); } }
public function getCountries(array $languageCodes) { return Countries::create($this->requestHandler)->setLanguageCodes($languageCodes); }