You are here

function CurrencyTokenWebTestCase::testTokenIntegration in Currency 7.2

Tests token integration.

File

currency/tests/CurrencyTokenWebTestCase.test, line 35
Contains class CurrencyTokenWebTestCase.

Class

CurrencyTokenWebTestCase
Tests Token integration.

Code

function testTokenIntegration() {
  $data = array(
    'EUR' => array(
      '[currency:code]' => 'EUR',
      '[currency:number]' => '978',
      '[currency:subunits]' => '100',
    ),
    'BHD' => array(
      '[currency:code]' => 'BHD',
      '[currency:number]' => '048',
      '[currency:subunits]' => '1000',
    ),
  );
  foreach ($data as $currency_code => $tokens) {
    $data = array(
      'currency' => $currency_code,
    );
    foreach ($tokens as $token => $replacement) {
      $this
        ->assertEqual(token_replace($token, $data), $replacement);
    }
  }
}