You are here

public function EntityTest::testValidateArgumentBundle in Zircon Profile 8

Same name and namespace in other branches
  1. 8.0 core/modules/views/tests/src/Unit/Plugin/argument_validator/EntityTest.php \Drupal\Tests\views\Unit\Plugin\argument_validator\EntityTest::testValidateArgumentBundle()

Tests the validate argument method with bundle checking.

File

core/modules/views/tests/src/Unit/Plugin/argument_validator/EntityTest.php, line 167
Contains \Drupal\Tests\views\Unit\Plugin\argument_validator\EntityTest.

Class

EntityTest
@coversDefaultClass \Drupal\views\Plugin\views\argument_validator\Entity @group views

Namespace

Drupal\Tests\views\Unit\Plugin\argument_validator

Code

public function testValidateArgumentBundle() {
  $options = array();
  $options['access'] = FALSE;
  $options['bundles'] = array(
    'test_bundle' => 1,
  );
  $this->argumentValidator
    ->init($this->executable, $this->display, $options);
  $this
    ->assertTrue($this->argumentValidator
    ->validateArgument(1));
  $this
    ->assertFalse($this->argumentValidator
    ->validateArgument(2));
}