diff options
author | Thomas Steur <thomas.steur@gmail.com> | 2016-04-06 00:34:07 +0300 |
---|---|---|
committer | Thomas Steur <thomas.steur@gmail.com> | 2016-04-06 00:34:07 +0300 |
commit | fd650c6cf7c4c65569ec1195545db79f02c832c8 (patch) | |
tree | a5e84a64a049eb6af47261f3033f87907ab569bf /tests | |
parent | 2be3eb29c48748236411cf98979876a1dc54f03e (diff) |
added test case
Diffstat (limited to 'tests')
-rw-r--r-- | tests/PHPUnit/Integration/CronArchiveTest.php | 28 |
1 files changed, 28 insertions, 0 deletions
diff --git a/tests/PHPUnit/Integration/CronArchiveTest.php b/tests/PHPUnit/Integration/CronArchiveTest.php index c8f97754fc..1fc6eaa075 100644 --- a/tests/PHPUnit/Integration/CronArchiveTest.php +++ b/tests/PHPUnit/Integration/CronArchiveTest.php @@ -140,6 +140,34 @@ LOG; $this->assertStringMatchesFormat($expected, $logger->output); } + public function test_shouldNotStopProcessingWhenOneSiteIsInvalid() + { + \Piwik\Tests\Framework\Mock\FakeCliMulti::$specifiedResults = array( + '/method=API.get/' => serialize(array(array('nb_visits' => 1))) + ); + + Fixture::createWebsite('2014-12-12 00:01:02'); + + $logger = new FakeLogger(); + + $archiver = new CronArchive(null, $logger); + $archiver->shouldArchiveSpecifiedSites = array(99999, 1); + $archiver->init(); + $archiver->run(); + + $expected = <<<LOG +- Will process 2 websites (--force-idsites) +Will ignore websites and help finish a previous started queue instead. IDs: 1 +--------------------------- +START +Starting Piwik reports archiving... +Will pre-process for website id = 1, period = day, date = last52 +- pre-processing all visits +LOG; + + $this->assertContains($expected, $logger->output); + } + public function provideContainerConfig() { return array( |