You are here

function CurrencyDeleteFormWebTest::testForm in Currency 8.3

Tests the form.

File

tests/src/Functional/Entity/Currency/CurrencyDeleteFormWebTest.php, line 24

Class

CurrencyDeleteFormWebTest
\Drupal\currency\Entity\CurrencyDeleteForm web test.

Namespace

Drupal\Tests\currency\Functional\Entity\Currency

Code

function testForm() {
  $user = $this
    ->drupalCreateUser(array(
    'currency.currency.delete',
  ));
  $this
    ->drupalLogin($user);
  $storage = \Drupal::entityTypeManager()
    ->getStorage('currency');
  $currency = $storage
    ->create(array(
    'currencyCode' => 'ABC',
  ));
  $currency
    ->save();
  $this
    ->drupalPostForm('admin/config/regional/currency/' . $currency
    ->id() . '/delete', array(), t('Delete'));
  $storage
    ->resetCache();
  $this
    ->assertFalse((bool) $storage
    ->load($currency
    ->id()));
}