StatisticsTestBase.php in Drupal 10
File
core/modules/statistics/tests/src/Functional/StatisticsTestBase.php
View source
<?php
namespace Drupal\Tests\statistics\Functional;
use Drupal\Tests\BrowserTestBase;
abstract class StatisticsTestBase extends BrowserTestBase {
protected static $modules = [
'node',
'block',
'ban',
'statistics',
];
protected $blockingUser;
protected function setUp() : void {
parent::setUp();
if ($this->profile != 'standard') {
$this
->drupalCreateContentType([
'type' => 'page',
'name' => 'Basic page',
]);
}
$this->blockingUser = $this
->drupalCreateUser([
'access administration pages',
'access site reports',
'ban IP addresses',
'administer blocks',
'administer statistics',
'administer users',
]);
$this
->drupalLogin($this->blockingUser);
$this
->config('statistics.settings')
->set('count_content_views', 1)
->save();
}
}