PluginBasedExchangeRateProviderFormWebTest.php in Currency 8.3
File
tests/src/Functional/Controller/PluginBasedExchangeRateProviderFormWebTest.php
View source
<?php
namespace Drupal\Tests\currency\Functional\Controller;
use Drupal\Tests\BrowserTestBase;
class PluginBasedExchangeRateProviderFormWebTest extends BrowserTestBase {
public static $modules = array(
'currency',
);
protected $defaultTheme = 'stark';
function testCurrencyExchangerUI() {
$exchange_delegator = \Drupal::service('currency.exchange_rate_provider');
$user = $this
->drupalCreateUser(array(
'currency.exchange_rate_provider.administer',
));
$this
->drupalLogin($user);
$this
->assertEqual(array(
'currency_fixed_rates' => TRUE,
'currency_historical_rates' => TRUE,
), $exchange_delegator
->loadConfiguration());
$path = 'admin/config/regional/currency-exchange';
$values = array(
'exchange_rate_providers[currency_fixed_rates][enabled]' => FALSE,
);
$this
->drupalPostForm($path, $values, t('Save'));
$this
->assertEqual(array(
'currency_fixed_rates' => FALSE,
'currency_historical_rates' => TRUE,
), $exchange_delegator
->loadConfiguration());
}
}