public function testGetOptionCurrencies() { $allowedCurrencies = ['USD', 'EUR', 'GBP', 'UAH']; $this->mockConfig->expects($this->once())->method('getAllowedCurrencies')->will($this->returnValue($allowedCurrencies)); $expectedResults = ['USD', 'EUR', 'GBP', 'UAH']; $currencyList = $this->listsModel->getOptionCurrencies(); $currencyCodes = array_map(function ($data) { return $data['value']; }, $currencyList); foreach ($expectedResults as $value) { $this->assertContains($value, $currencyCodes); } }
public function testGetOptionCurrencies() { $allowedCurrencies = ['USD', 'EUR', 'GBP', 'UAH']; $this->mockConfig->expects($this->once())->method('getAllowedCurrencies')->will($this->returnValue($allowedCurrencies)); $expectedResults = ['USD', 'EUR', 'GBP', 'UAH']; $currencyList = $this->listsModel->getOptionCurrencies(); foreach ($expectedResults as $value) { $found = false; foreach ($currencyList as $item) { $found = $found || $value == $item['value']; } $this->assertTrue($found); } }