You are here

function AmountFormattingFormWebTest::testListing in Currency 8.3

Same name in this branch
  1. 8.3 tests/src/Functional/Controller/AmountFormattingFormWebTest.php \Drupal\Tests\currency\Functional\Controller\AmountFormattingFormWebTest::testListing()
  2. 8.3 tests/src/Functional/Form/AmountFormattingFormWebTest.php \Drupal\Tests\currency\Functional\Form\AmountFormattingFormWebTest::testListing()

Tests listing().

File

tests/src/Functional/Form/AmountFormattingFormWebTest.php, line 24

Class

AmountFormattingFormWebTest
\Drupal\currency\Form\AmountFormattingForm web test.

Namespace

Drupal\Tests\currency\Functional\Form

Code

function testListing() {
  $account = $this
    ->drupalCreateUser(array(
    'access administration pages',
  ));
  $this
    ->drupalLogin($account);
  $this
    ->drupalGet('admin/config/regional/currency-formatting');
  $this
    ->assertResponse('403');
  $account = $this
    ->drupalCreateUser(array(
    'currency.amount_formatting.administer',
  ));
  $this
    ->drupalLogin($account);
  $this
    ->drupalGet('admin/config/regional/currency-formatting');
  $this
    ->assertResponse('200');
  $this
    ->assertFieldChecked('edit-default-plugin-id-currency-basic');
  $this
    ->drupalPostForm(NULL, array(), t('Save configuration'));
}