示例#1
0
 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);
     }
 }
示例#2
0
 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);
     }
 }
示例#3
0
 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);
     }
 }