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;
class CurrencyDeleteFormWebTest extends BrowserTestBase {
public static $modules = array(
'currency',
);
protected $defaultTheme = 'stark';
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()));
}
}