Example #1
0
 public function testGetOptionAllCurrencies()
 {
     $locale = new \Magento\Framework\Locale('en');
     $this->mockLocaleResolver->expects($this->exactly(2))->method('getLocale')->will($this->returnValue($locale));
     // clearly English results
     $expectedResults = [['value' => 'BAM', 'label' => 'Bosnia-Herzegovina Convertible Mark'], ['value' => 'TTD', 'label' => 'Trinidad and Tobago Dollar'], ['value' => 'USN', 'label' => 'US Dollar (Next day)'], ['value' => 'USS', 'label' => 'US Dollar (Same day)']];
     $currencyList = $this->listsModel->getOptionAllCurrencies();
     foreach ($expectedResults as $value) {
         $this->assertContains($value, $currencyList);
     }
 }
Example #2
0
 public function testGetOptionAllCurrencies()
 {
     $expectedResults = ['USD', 'EUR', 'GBP', 'UAH'];
     $currencyList = $this->listsModel->getOptionAllCurrencies();
     foreach ($expectedResults as $value) {
         $found = false;
         foreach ($currencyList as $item) {
             $found = $found || $value == $item['value'];
         }
         $this->assertTrue($found);
     }
 }