protected function QueryTest::queryMethodsTests

Test methods provided by the QueryPluginBase.

See also

\Drupal\views\Plugin\views\query\QueryPluginBase

1 call to QueryTest::queryMethodsTests()
QueryTest::testQuery in drupal/core/modules/views/lib/Drupal/views/Tests/Plugin/QueryTest.php
Tests query plugins.

File

drupal/core/modules/views/lib/Drupal/views/Tests/Plugin/QueryTest.php, line 76
Definition of Drupal\views\Tests\Plugin\QueryTest.

Class

QueryTest
Tests query plugins.

Namespace

Drupal\views\Tests\Plugin

Code

protected function queryMethodsTests() {
  $view = views_get_view('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.');
}