Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/matomo-org/matomo.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
Diffstat (limited to 'tests/PHPUnit/Fixtures/EmptySiteWithSiteContentDetectionGA4.php')
-rw-r--r--tests/PHPUnit/Fixtures/EmptySiteWithSiteContentDetectionGA4.php58
1 files changed, 58 insertions, 0 deletions
diff --git a/tests/PHPUnit/Fixtures/EmptySiteWithSiteContentDetectionGA4.php b/tests/PHPUnit/Fixtures/EmptySiteWithSiteContentDetectionGA4.php
new file mode 100644
index 0000000000..04c8c22bc3
--- /dev/null
+++ b/tests/PHPUnit/Fixtures/EmptySiteWithSiteContentDetectionGA4.php
@@ -0,0 +1,58 @@
+<?php
+/**
+ * Matomo - free/libre analytics platform
+ *
+ * @link https://matomo.org
+ * @license http://www.gnu.org/licenses/gpl-3.0.html GPL v3 or later
+ */
+namespace Piwik\Tests\Fixtures;
+
+use Piwik\Tests\Framework\Fixture;
+use Piwik\SiteContentDetector;
+use Piwik\Tests\Framework\Mock\FakeSiteContentDetector;
+
+/**
+ * Fixture that adds one site with no visits and configures site content detection test data so that GA4 will be
+ * detected on the site.
+ */
+class EmptySiteWithSiteContentDetectionGA4 extends Fixture
+{
+ public $idSite = 1;
+
+ public function provideContainerConfig()
+ {
+ $mockData = [
+ 'consentManagerId' => null,
+ 'consentManagerName' => null,
+ 'consentManagerUrl' => null,
+ 'isConnected' => false,
+ 'ga3' => false,
+ 'ga4' => true,
+ 'gtm' => false
+ ];
+
+ return [
+ SiteContentDetector::class => \DI\autowire(FakeSiteContentDetector::class)
+ ->constructorParameter('mockData', $mockData)
+ ];
+ }
+
+ public function setUp(): void
+ {
+ Fixture::createSuperUser();
+ $this->setUpWebsites();
+ }
+
+ public function tearDown(): void
+ {
+ // empty
+ }
+
+ private function setUpWebsites()
+ {
+ if (!self::siteCreated($idSite = 1)) {
+ self::createWebsite('2021-01-01');
+ }
+ }
+
+}