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); } }
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); } }