You are here

function AmountTest::testGetCurrencyWithoutLoadableCurrencies in Currency 8.3

@covers ::getCurrency

File

tests/src/Unit/Plugin/views/field/AmountTest.php, line 250

Class

AmountTest
@coversDefaultClass \Drupal\currency\Plugin\views\field\Amount

Namespace

Drupal\Tests\currency\Unit\Plugin\views\field

Code

function testGetCurrencyWithoutLoadableCurrencies() {
  $this
    ->expectException(RuntimeException::class);
  $this->currencyStorage
    ->expects($this
    ->atLeastOnce())
    ->method('load')
    ->willReturn(NULL);
  $result_row = new ResultRow();
  $method = new \ReflectionMethod($this->sut, 'getCurrency');
  $method
    ->setAccessible(TRUE);
  $method
    ->invoke($this->sut, $result_row);
}