Files
xxx/tests/php/Pages/NoAnalyticsTest.php
tim 65426a327d Remove Google Analytics.
Google shut down the Universal Analytics script that the pages loaded,
and we haven't used it probably a decade
2026-09-26 15:27:51 +02:00

20 lines
665 B
PHP

<?php
namespace Xxx\Tests\Pages;
use Xxx\Tests\Support\PageTestCase;
// The site has no Google Analytics, even with the old GOOGLE_ANALYTICS_ID in the environment
class NoAnalyticsTest extends PageTestCase {
protected static function serverEnv(): array {
return array('GOOGLE_ANALYTICS_ID' => 'UA-12345-1');
}
public function testNoPageLoadsAnalytics(): void {
foreach (array('/', '/article', '/about', '/publish', '/publish/login') as $path) {
$body = $this->get($path)['body'];
$this->assertStringNotContainsString('UA-12345-1', $body, $path);
$this->assertStringNotContainsString('google-analytics', $body, $path);
}
}
}