protected function QueryTest::queryMethodsTests in Zircon Profile 8
Same name and namespace in other branches
- 8.0 core/modules/views/src/Tests/Plugin/QueryTest.php \Drupal\views\Tests\Plugin\QueryTest::queryMethodsTests()
Test methods provided by the QueryPluginBase.
See also
\Drupal\views\Plugin\views\query\QueryPluginBase
1 call to QueryTest::queryMethodsTests()
- QueryTest::testQuery in core/
modules/ views/ src/ Tests/ Plugin/ QueryTest.php - Tests query plugins.
File
- core/
modules/ views/ src/ Tests/ Plugin/ QueryTest.php, line 71 - Contains \Drupal\views\Tests\Plugin\QueryTest.
Class
- QueryTest
- Tests query plugins.
Namespace
Drupal\views\Tests\PluginCode
protected function queryMethodsTests() {
$view = Views::getView('test_view');
$view
->setDisplay();
$view
->initQuery();
$this
->assertFalse($view->query
->getLimit(), 'Default to an empty limit.');
$rand_number = rand(5, 10);
$view->query
->setLimit($rand_number);
$this
->assertEqual($view->query
->getLimit(), $rand_number, 'set_limit adapts the amount of items.');
}