diff options
author | Thomas Steur <tsteur@users.noreply.github.com> | 2020-09-11 02:01:16 +0300 |
---|---|---|
committer | GitHub <noreply@github.com> | 2020-09-11 02:01:16 +0300 |
commit | 748ac97ed42afc3df929af4f83de4384105d21b3 (patch) | |
tree | 3933c66516bf4e6e595f4a9b3ff1ae5114b2cd67 /tests | |
parent | 695f7c80a105ecb928af9e458d89fe3751552434 (diff) |
Add more debug information for some specific archiving errors (#16387)
Diffstat (limited to 'tests')
-rw-r--r-- | tests/PHPUnit/Integration/Archive/DataTableFactoryTest.php | 15 |
1 files changed, 15 insertions, 0 deletions
diff --git a/tests/PHPUnit/Integration/Archive/DataTableFactoryTest.php b/tests/PHPUnit/Integration/Archive/DataTableFactoryTest.php index 284858a50a..6f735e64f4 100644 --- a/tests/PHPUnit/Integration/Archive/DataTableFactoryTest.php +++ b/tests/PHPUnit/Integration/Archive/DataTableFactoryTest.php @@ -16,6 +16,7 @@ use Piwik\Db; use Piwik\Period; use Piwik\Plugins\SegmentEditor\API; use Piwik\Segment; +use Piwik\Site; use Piwik\Tests\Framework\Fixture; use Piwik\Tests\Framework\Mock\FakeAccess; use Piwik\Tests\Framework\TestCase\IntegrationTestCase; @@ -56,6 +57,20 @@ class DataTableFactoryTest extends IntegrationTestCase API::getInstance()->add('TEST SEGMENT', 'browserCode==ff'); } + public function test_getSiteIdFromMetadata_no_site() + { + $siteid = DataTableFactory::getSiteIdFromMetadata(new DataTable()); + $this->assertNull($siteid); + } + + public function test_getSiteIdFromMetadata() + { + $table = new DataTable(); + $table->setMetadata('site', new Site($this->site1)); + $siteid = DataTableFactory::getSiteIdFromMetadata($table); + $this->assertEquals($this->site1, $siteid); + } + public function test_makeMerged_numeric_noIndices_shouldContainDefaultRow_IfNoDataGiven() { $indices = $this->getResultIndices($period = false, $site = false); |