class ArgumentValidatorTest in Drupal 10
Same name in this branch
- 10 core/modules/views_ui/tests/src/Functional/ArgumentValidatorTest.php \Drupal\Tests\views_ui\Functional\ArgumentValidatorTest
- 10 core/modules/views/tests/src/Kernel/Plugin/ArgumentValidatorTest.php \Drupal\Tests\views\Kernel\Plugin\ArgumentValidatorTest
- 10 core/modules/views/tests/modules/views_test_data/src/Plugin/views/argument_validator/ArgumentValidatorTest.php \Drupal\views_test_data\Plugin\views\argument_validator\ArgumentValidatorTest
Same name and namespace in other branches
- 8 core/modules/views/tests/modules/views_test_data/src/Plugin/views/argument_validator/ArgumentValidatorTest.php \Drupal\views_test_data\Plugin\views\argument_validator\ArgumentValidatorTest
- 9 core/modules/views/tests/modules/views_test_data/src/Plugin/views/argument_validator/ArgumentValidatorTest.php \Drupal\views_test_data\Plugin\views\argument_validator\ArgumentValidatorTest
Defines an argument validator test plugin.
Plugin annotation
@ViewsArgumentValidator(
id = "argument_validator_test",
title = @Translation("Argument validator test")
)
Hierarchy
- class \Drupal\views_test_data\Plugin\views\argument_validator\ArgumentValidatorTest extends \Drupal\views\Plugin\views\argument_validator\ArgumentValidatorPluginBase
Expanded class hierarchy of ArgumentValidatorTest
1 file declares its use of ArgumentValidatorTest
- ArgumentValidatorTest.php in core/
modules/ views/ tests/ src/ Kernel/ Plugin/ ArgumentValidatorTest.php
3 string references to 'ArgumentValidatorTest'
- ArgumentValidatorTest::calculateDependencies in core/
modules/ views/ tests/ modules/ views_test_data/ src/ Plugin/ views/ argument_validator/ ArgumentValidatorTest.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_validator/ ArgumentValidatorTest.php, line 15
Namespace
Drupal\views_test_data\Plugin\views\argument_validatorView source
class ArgumentValidatorTest extends ArgumentValidatorPluginBase {
/**
* {@inheritdoc}
*/
public function calculateDependencies() {
return [
'content' => [
'ArgumentValidatorTest',
],
];
}
/**
* {@inheritdoc}
*/
protected function defineOptions() {
$options = parent::defineOptions();
$options['test_value'] = [
'default' => '',
];
return $options;
}
/**
* {@inheritdoc}
*/
public function validateArgument($arg) {
if ($arg === 'this value should be replaced') {
// Set the argument to a numeric value so this is valid on PostgreSQL for
// numeric fields.
$this->argument->argument = '1';
return TRUE;
}
return $arg == $this->options['test_value'];
}
}
Members
Name | Modifiers | Type | Description | Overrides |
---|---|---|---|---|
ArgumentValidatorTest:: |
public | function | ||
ArgumentValidatorTest:: |
protected | function | ||
ArgumentValidatorTest:: |
public | function |