public function testGetOptionCountries() { $expectedResults = ['US', 'GB', 'DE', 'UA']; $list = $this->listsModel->getOptionCountries(); foreach ($expectedResults as $value) { $found = false; foreach ($list as $item) { $found = $found || $value == $item['value']; } $this->assertTrue($found); } }
public function testGetOptionCountries() { $locale = new \Magento\Framework\Locale('en'); $this->mockLocaleResolver->expects($this->once())->method('getLocale')->will($this->returnValue($locale)); // clearly English results $expectedResults = [['value' => 'AG', 'label' => 'Antigua and Barbuda'], ['value' => 'BA', 'label' => 'Bosnia and Herzegovina'], ['value' => 'CT', 'label' => 'Canton and Enderbury Islands'], ['value' => 'GS', 'label' => 'South Georgia and the South Sandwich Islands'], ['value' => 'PU', 'label' => 'U.S. Miscellaneous Pacific Islands']]; $optionCountries = $this->listsModel->getOptionCountries(); foreach ($expectedResults as $value) { $this->assertContains($value, $optionCountries); } }
public function testGetOptionCountries() { $locale = new \Magento\Framework\Locale('en'); $this->mockLocaleResolver->expects($this->once())->method('getLocale')->will($this->returnValue($locale)); // clearly English results $expectedResults = [['value' => 'AG', 'label' => 'Antigua and Barbuda'], ['value' => 'BA', 'label' => 'Bosnia and Herzegovina'], ['value' => 'CC', 'label' => 'Cocos (Keeling) Islands'], ['value' => 'GS', 'label' => 'South Georgia & South Sandwich Islands'], ['value' => 'PM', 'label' => 'Saint Pierre and Miquelon']]; $optionCountries = $this->listsModel->getOptionCountries(); foreach ($expectedResults as $value) { $this->assertContains($value, $optionCountries); } }