protected function ViewsDataTest::assertCountIncrement

Asserts that the count for hook_views_data either equal or has increased.

Parameters

bool $equal: Whether to assert that the count should be equal. Defaults to FALSE.

1 call to ViewsDataTest::assertCountIncrement()
ViewsDataTest::testViewsFetchData in drupal/core/modules/views/lib/Drupal/views/Tests/ViewsDataTest.php
Tests the views.views_data service.

File

drupal/core/modules/views/lib/Drupal/views/Tests/ViewsDataTest.php, line 251
Definition of Drupal\views\Tests\ViewsDataTest.

Class

ViewsDataTest
Tests the fetching of views data.

Namespace

Drupal\views\Tests

Code

protected function assertCountIncrement($increment = TRUE) {
  if ($increment) {

    // If an incremented count is expected, increment this now.
    $this->count++;
    $message = 'hook_views_data has been invoked.';
  }
  else {
    $message = 'hook_views_data has not been invoked';
  }
  $this
    ->assertEqual($this->count, $this->state
    ->get('views_test_data_views_data_count'), $message);
}