You are here

public function StatisticsAttachedTest::testAttached in Zircon Profile 8.0

Same name and namespace in other branches
  1. 8 core/modules/statistics/src/Tests/StatisticsAttachedTest.php \Drupal\statistics\Tests\StatisticsAttachedTest::testAttached()

Tests if statistics.js is loaded when content is not printed.

File

core/modules/statistics/src/Tests/StatisticsAttachedTest.php, line 49
Contains \Drupal\statistics\Tests\StatisticsAttachedTest.

Class

StatisticsAttachedTest
Tests if statistics.js is loaded when content is not printed.

Namespace

Drupal\statistics\Tests

Code

public function testAttached() {
  $node = Node::create([
    'type' => 'page',
    'title' => 'Page node',
    'body' => 'body text',
  ]);
  $node
    ->save();
  $this
    ->drupalGet('node/' . $node
    ->id());
  $this
    ->assertRaw('core/modules/statistics/statistics.js', 'Statistics library is available');
}