You are here

CurrencyDeleteFormWebTest.php in Currency 8.3

File

tests/src/Functional/Entity/Currency/CurrencyDeleteFormWebTest.php
View source
<?php

namespace Drupal\Tests\currency\Functional\Entity\Currency;

use Drupal\Tests\BrowserTestBase;

/**
 * \Drupal\currency\Entity\CurrencyDeleteForm web test.
 *
 * @group Currency
 */
class CurrencyDeleteFormWebTest extends BrowserTestBase {
  public static $modules = array(
    'currency',
  );

  /**
   * {@inheritdoc}
   */
  protected $defaultTheme = 'stark';

  /**
   * Tests the form.
   */
  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()));
  }

}

Classes

Namesort descending Description
CurrencyDeleteFormWebTest \Drupal\currency\Entity\CurrencyDeleteForm web test.