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/Unit/PeriodTest.php')
-rw-r--r--tests/PHPUnit/Unit/PeriodTest.php37
1 files changed, 2 insertions, 35 deletions
diff --git a/tests/PHPUnit/Unit/PeriodTest.php b/tests/PHPUnit/Unit/PeriodTest.php
index f4c7d4ee1d..b3f6b06adf 100644
--- a/tests/PHPUnit/Unit/PeriodTest.php
+++ b/tests/PHPUnit/Unit/PeriodTest.php
@@ -14,6 +14,7 @@ use Piwik\Period;
use Piwik\Period\Month;
use Piwik\Period\Week;
use Piwik\Period\Year;
+use Piwik\Translation\Translator;
/**
* @group Core
@@ -52,40 +53,6 @@ class PeriodTest extends \PHPUnit_Framework_TestCase
$this->assertNotEmpty($label);
}
- public function testFactoryDay()
- {
- $period = Period\Factory::build('day', Date::today());
- $this->assertInstanceOf('\Piwik\Period\Day', $period);
- }
-
- public function testFactoryMonth()
- {
- $period = Period\Factory::build('month', Date::today());
- $this->assertInstanceOf('\Piwik\Period\Month', $period);
- }
-
- public function testFactoryWeek()
- {
- $period = Period\Factory::build('week', Date::today());
- $this->assertInstanceOf('\Piwik\Period\Week', $period);
- }
-
- public function testFactoryYear()
- {
- $period = Period\Factory::build('year', Date::today());
- $this->assertInstanceOf('\Piwik\Period\Year', $period);
- }
-
- public function testFactoryInvalid()
- {
- try {
- Period\Factory::build('inValid', Date::today());
- } catch (\Exception $e) {
- return;
- }
- $this->fail('Expected Exception not raised');
- }
-
public function testValidate_ValidDates()
{
Period::checkDateFormat('today');
@@ -102,7 +69,7 @@ class PeriodTest extends \PHPUnit_Framework_TestCase
/**
* @expectedException \Exception
- * @expectedExceptionMessage General_ExceptionInvalidDateFormat
+ * @expectedExceptionMessage Date format must be: YYYY-MM-DD, or 'today' or 'yesterday' or any keyword supported by the strtotime function (see http://php.net/strtotime for more information):
* @dataProvider getInvalidDateFormats
*/
public function testValidate_InvalidDates($invalidDateFormat)