3 namespace Drupal\Tests\statistics\Functional;
5 use Drupal\Tests\BrowserTestBase;
8 * Defines a base class for testing the Statistics module.
10 abstract class StatisticsTestBase extends BrowserTestBase {
17 public static $modules = ['node', 'block', 'ban', 'statistics'];
20 * User with permissions to ban IP's.
22 * @var \Drupal\user\UserInterface
24 protected $blockingUser;
26 protected function setUp() {
29 // Create Basic page node type.
30 if ($this->profile != 'standard') {
31 $this->drupalCreateContentType(['type' => 'page', 'name' => 'Basic page']);
35 $this->blockingUser = $this->drupalCreateUser([
36 'access administration pages',
37 'access site reports',
40 'administer statistics',
43 $this->drupalLogin($this->blockingUser);
46 $this->config('statistics.settings')
47 ->set('count_content_views', 1)