diff options
author | Thomas Steur <thomas.steur@googlemail.com> | 2014-10-05 15:05:47 +0400 |
---|---|---|
committer | Thomas Steur <thomas.steur@googlemail.com> | 2014-10-05 15:05:47 +0400 |
commit | 5a1eab97f54b44f57356b4276b9c9df2a8eef51b (patch) | |
tree | 83864ece2806ccf6e6bb49abf3fd65de92c13ad8 /tests/PHPUnit/Core/ScheduledTime/HourlyTest.php | |
parent | 19bcd2d262343eae9d553378e4c66ce7e033b4d8 (diff) |
refs #5940 put tests in correct folders, better testsuite names, some tests still fail and I cannot figure out why
Diffstat (limited to 'tests/PHPUnit/Core/ScheduledTime/HourlyTest.php')
-rw-r--r-- | tests/PHPUnit/Core/ScheduledTime/HourlyTest.php | 90 |
1 files changed, 0 insertions, 90 deletions
diff --git a/tests/PHPUnit/Core/ScheduledTime/HourlyTest.php b/tests/PHPUnit/Core/ScheduledTime/HourlyTest.php deleted file mode 100644 index 14f4ce3c0e..0000000000 --- a/tests/PHPUnit/Core/ScheduledTime/HourlyTest.php +++ /dev/null @@ -1,90 +0,0 @@ -<?php -/** - * Piwik - free/libre analytics platform - * - * @link http://piwik.org - * @license http://www.gnu.org/licenses/gpl-3.0.html GPL v3 or later - */ -use Piwik\ScheduledTime\Hourly; - -class ScheduledTime_HourlyTest extends PHPUnit_Framework_TestCase -{ - private static $_JANUARY_01_1971_09_00_00; - private static $_JANUARY_01_1971_09_10_00; - private static $_JANUARY_01_1971_10_00_00; - - public static function setUpBeforeClass() - { - parent::setUpBeforeClass(); - self::$_JANUARY_01_1971_09_00_00 = mktime(9, 00, 00, 1, 1, 1971); - self::$_JANUARY_01_1971_09_10_00 = mktime(9, 10, 00, 1, 1, 1971); - self::$_JANUARY_01_1971_10_00_00 = mktime(10, 00, 00, 1, 1, 1971); - } - - /** - * Tests forbidden call to setHour on Hourly - * @group Core - */ - public function testSetHourScheduledTimeHourly() - { - try { - $hourlySchedule = new Hourly(); - $hourlySchedule->setHour(0); - } catch (Exception $e) { - return; - } - $this->fail('Expected exception not raised'); - } - - /** - * Tests forbidden call to setDay on Hourly - * @group Core - */ - public function testSetDayScheduledTimeHourly() - { - try { - $hourlySchedule = new Hourly(); - $hourlySchedule->setDay(1); - } catch (Exception $e) { - return; - } - $this->fail('Expected exception not raised'); - } - - /** - * Tests getRescheduledTime on Hourly - * @group Core - */ - public function testGetRescheduledTimeHourly() - { - /* - * Test 1 - * - * Context : - * - getRescheduledTime called Friday January 1 1971 09:00:00 GMT - * - * Expected : - * getRescheduledTime returns Friday January 1 1971 10:00:00 GMT - */ - $mock = $this->getMock('\Piwik\ScheduledTime\Hourly', array('getTime')); - $mock->expects($this->any()) - ->method('getTime') - ->will($this->returnValue(self::$_JANUARY_01_1971_09_00_00)); - $this->assertEquals(self::$_JANUARY_01_1971_10_00_00, $mock->getRescheduledTime()); - - /* - * Test 2 - * - * Context : - * - getRescheduledTime called Friday January 1 1971 09:10:00 GMT - * - * Expected : - * getRescheduledTime returns Friday January 1 1971 10:00:00 GMT - */ - $mock = $this->getMock('\Piwik\ScheduledTime\Hourly', array('getTime')); - $mock->expects($this->any()) - ->method('getTime') - ->will($this->returnValue(self::$_JANUARY_01_1971_09_10_00)); - $this->assertEquals(self::$_JANUARY_01_1971_10_00_00, $mock->getRescheduledTime()); - } -} |