1
0
قرینه از https://github.com/matomo-org/matomo.git synced 2025-08-22 15:07:44 +00:00
Files
matomo/plugins/SitesManager/tests/Fixtures/ManySites.php
Stefan Giehl 4703f9e3e1 Improve type checks in SitesManager API (#22704)
* Improve type checks in SitesManager API

* adjust tests

* submodule update

* Update plugins/SitesManager/tests/Integration/ApiTest.php

---------

Co-authored-by: Marc Neudert <marc@innocraft.com>
2024-10-25 08:49:58 +02:00

56 خطوط
1.5 KiB
PHP

<?php
/**
* Matomo - free/libre analytics platform
*
* @link https://matomo.org
* @license https://www.gnu.org/licenses/gpl-3.0.html GPL v3 or later
*/
namespace Piwik\Plugins\SitesManager\tests\Fixtures;
use Piwik\Plugin\Manager;
use Piwik\Plugins\MobileAppMeasurable;
use Piwik\Tests\Framework\Fixture;
/**
* Track actions with bandwidth
*/
class ManySites extends Fixture
{
public $dateTime = '2010-01-03 11:22:33';
public function setUp(): void
{
// Ensure plugin is activated, otherwise adding a site with this type will fail
Manager::getInstance()->activatePlugin('MobileAppMeasurable');
for ($idSite = 1; $idSite < 64; $idSite++) {
if (!self::siteCreated($idSite)) {
if ($idSite < 35) {
$siteName = 'SiteTest' . $idSite; // we generate different site names to be used in search
} else {
$siteName = 'Site ' . $idSite;
}
$type = null;
if ($idSite === 2) {
$type = MobileAppMeasurable\Type::ID;
}
self::createWebsite(
$this->dateTime,
$ecommerce = 0,
$siteName,
$siteUrl = false,
$siteSearch = 1,
$searchKeywordParameters = null,
$searchCategoryParameters = null,
$timezone = null,
$type
);
}
}
}
}