blob: 9a3d3666d998bc6595441c1cef423fce83b308da (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
|
<?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 the
* 'Osano' consent manager will be detected on the site.
*/
class EmptySiteWithSiteContentDetection extends Fixture
{
public $idSite = 1;
public function provideContainerConfig()
{
$mockData = [
'consentManagerId' => 'osano',
'consentManagerName' => 'Osano',
'consentManagerUrl' => 'https://matomo.org/faq/how-to/using-osano-consent-manager-with-matomo',
'isConnected' => true,
'ga3' => false,
'ga4' => false,
'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');
}
}
}
|