You are here

public function CurrencyWebTest::testHandler in Currency 8.3

Same name in this branch
  1. 8.3 tests/src/Functional/Plugin/views/filter/CurrencyWebTest.php \Drupal\Tests\currency\Functional\Plugin\views\filter\CurrencyWebTest::testHandler()
  2. 8.3 tests/src/Functional/Plugin/views/field/CurrencyWebTest.php \Drupal\Tests\currency\Functional\Plugin\views\field\CurrencyWebTest::testHandler()

Tests the handler.

File

tests/src/Functional/Plugin/views/filter/CurrencyWebTest.php, line 28

Class

CurrencyWebTest
\Drupal\currency\Plugin\views\filter\Currency web test.

Namespace

Drupal\Tests\currency\Functional\Plugin\views\filter

Code

public function testHandler() {
  $view_id = 'currency_test';
  $view = View::load($view_id);
  $view
    ->getExecutable()
    ->execute('default');

  // There are four rows, and the filter excludes NLG.
  $this
    ->assertEqual(count($view
    ->get('executable')->result), 3);
  $account = $this
    ->drupalCreateUser(array(
    'administer views',
  ));
  $this
    ->drupalLogin($account);
  $this
    ->drupalGet('admin/structure/views/nojs/handler/' . $view_id . '/default/filter/currency');

  /** @var \Drupal\currency\FormHelperInterface $form_helper */
  $form_helper = \Drupal::service('currency.form_helper');
  foreach ($form_helper
    ->getCurrencyOptions() as $option) {
    $this
      ->assertText($option);
  }
}