You are here

class ArgumentDefaultTest in Drupal 10

Same name in this branch
  1. 10 core/modules/views/tests/src/Functional/Plugin/ArgumentDefaultTest.php \Drupal\Tests\views\Functional\Plugin\ArgumentDefaultTest
  2. 10 core/modules/user/tests/src/Kernel/Views/ArgumentDefaultTest.php \Drupal\Tests\user\Kernel\Views\ArgumentDefaultTest
  3. 10 core/modules/views/tests/modules/views_test_data/src/Plugin/views/argument_default/ArgumentDefaultTest.php \Drupal\views_test_data\Plugin\views\argument_default\ArgumentDefaultTest
Same name and namespace in other branches
  1. 8 core/modules/views/tests/modules/views_test_data/src/Plugin/views/argument_default/ArgumentDefaultTest.php \Drupal\views_test_data\Plugin\views\argument_default\ArgumentDefaultTest
  2. 9 core/modules/views/tests/modules/views_test_data/src/Plugin/views/argument_default/ArgumentDefaultTest.php \Drupal\views_test_data\Plugin\views\argument_default\ArgumentDefaultTest

Defines an argument default test plugin.

Plugin annotation


@ViewsArgumentDefault(
  id = "argument_default_test",
  title = @Translation("Argument default test")
)

Hierarchy

  • class \Drupal\views_test_data\Plugin\views\argument_default\ArgumentDefaultTest extends \Drupal\views\Plugin\views\argument_default\ArgumentDefaultPluginBase

Expanded class hierarchy of ArgumentDefaultTest

1 file declares its use of ArgumentDefaultTest
ArgumentDefaultTest.php in core/modules/views/tests/src/Functional/Plugin/ArgumentDefaultTest.php
3 string references to 'ArgumentDefaultTest'
ArgumentDefaultTest::calculateDependencies in core/modules/views/tests/modules/views_test_data/src/Plugin/views/argument_default/ArgumentDefaultTest.php
ViewEntityDependenciesTest::testGetDependencies in core/modules/views/tests/src/Kernel/Entity/ViewEntityDependenciesTest.php
Tests the getDependencies method.
views.view.test_argument_dependency.yml in core/modules/views/tests/modules/views_test_config/test_views/views.view.test_argument_dependency.yml
core/modules/views/tests/modules/views_test_config/test_views/views.view.test_argument_dependency.yml

File

core/modules/views/tests/modules/views_test_data/src/Plugin/views/argument_default/ArgumentDefaultTest.php, line 15

Namespace

Drupal\views_test_data\Plugin\views\argument_default
View source
class ArgumentDefaultTest extends ArgumentDefaultPluginBase {

  /**
   * {@inheritdoc}
   */
  protected function defineOptions() {
    $options = parent::defineOptions();
    $options['value'] = [
      'default' => '',
    ];
    return $options;
  }

  /**
   * {@inheritdoc}
   */
  public function getArgument() {
    $this->view->element['#cache']['tags'][] = 'example_tag';
    return $this->options['value'];
  }

  /**
   * {@inheritdoc}
   */
  public function calculateDependencies() {
    return [
      'content' => [
        'ArgumentDefaultTest',
      ],
    ];
  }

}

Members