Fixed bug #14096: scheduler: Move the scheduler tests to the scheduler sysext
authorChristian Kuhn <lolli@schwarzbu.ch>
Tue, 20 Apr 2010 12:17:25 +0000 (12:17 +0000)
committerChristian Kuhn <lolli@schwarzbu.ch>
Tue, 20 Apr 2010 12:17:25 +0000 (12:17 +0000)
git-svn-id: https://svn.typo3.org/TYPO3v4/Core/trunk@7404 709f56b5-9817-0410-a4d7-c38de5d9e867

ChangeLog
tests/typo3/sysext/scheduler/tx_scheduler_croncmd_testcase.php [deleted file]
typo3/sysext/scheduler/tests/tx_scheduler_croncmd_testcase.php [new file with mode: 0644]

index 81406ba..4e5b9bf 100755 (executable)
--- a/ChangeLog
+++ b/ChangeLog
@@ -4,6 +4,7 @@
 
 2010-04-20  Christian Kuhn  <lolli@schwarzbu.ch>
 
+       * Fixed bug #14096: scheduler: Move the scheduler tests to the scheduler sysext
        * Fixed bug #13471: List module eats up tons of memory if displaying records with many references
        * Fixed bug #14152: Table sys_log, field details is too small
        * Fixed bug #13908: saltedpasswords: Enhance Unit Tests by testing passwords of various character classes (thanks to Marcus Krause)
diff --git a/tests/typo3/sysext/scheduler/tx_scheduler_croncmd_testcase.php b/tests/typo3/sysext/scheduler/tx_scheduler_croncmd_testcase.php
deleted file mode 100644 (file)
index b3e41ff..0000000
+++ /dev/null
@@ -1,151 +0,0 @@
-<?php
-/***************************************************************
-*  Copyright notice
-*
-*  (c) 2010 Christian Kuhn <lolli@schwarzbu.ch>
-*  All rights reserved
-*
-*  This script is part of the TYPO3 project. The TYPO3 project is
-*  free software; you can redistribute it and/or modify
-*  it under the terms of the GNU General Public License as published by
-*  the Free Software Foundation; either version 2 of the License, or
-*  (at your option) any later version.
-*
-*  The GNU General Public License can be found at
-*  http://www.gnu.org/copyleft/gpl.html.
-*
-*  This script is distributed in the hope that it will be useful,
-*  but WITHOUT ANY WARRANTY; without even the implied warranty of
-*  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
-*  GNU General Public License for more details.
-*
-*  This copyright notice MUST APPEAR in all copies of the script!
-***************************************************************/
-
-/**
- * Testcase for class "tx_scheduler_CronCmd"
- *
- * @package TYPO3
- * @subpackage tx_scheduler
- *
- * @author Christian Kuhn <lolli@schwarzbu.ch>
- */
-class tx_scheduler_croncmd_testcase extends tx_phpunit_testcase {
-       /**
-        * @const       integer timestamp of 1.1.2010 0:00 (Friday)
-        */
-       const TIMESTAMP = 1262300400;
-
-       /**
-        * Tests whether dayList is correctly calculated for a single day of month
-        *
-        * @test
-        */
-       public function isDayListCorrectForOneDayOfMonth() {
-               if (!t3lib_extMgm::isLoaded('scheduler')) {
-                       $this->markTestSkipped(
-                               'This test only is applicable if the scheduler is installed.'
-                       );
-               }
-
-               $cronCmdInstance = t3lib_div::makeInstance('tx_scheduler_cronCmd', '* * 2 * *');
-               $expectedResult = array(
-                       '0' => 2,
-               );
-               $actualResult = $cronCmdInstance->valid_values;
-               $this->assertEquals($expectedResult, $actualResult[2]);
-       }
-
-       /**
-        * Tests whether dayList is correctly calculated for a comma separated list of month days
-        *
-        * @test
-        */
-       public function isDayListCorrectForListOfDayOfMonth() {
-               if (!t3lib_extMgm::isLoaded('scheduler')) {
-                       $this->markTestSkipped(
-                               'This test only is applicable if the scheduler is installed.'
-                       );
-               }
-
-               $cronCmdInstance = t3lib_div::makeInstance('tx_scheduler_cronCmd', '* * 2,7 * *');
-               $expectedResult = array(
-                       '0' => 2,
-                       '1' => 7,
-               );
-               $actualResult = $cronCmdInstance->valid_values;
-               $this->assertEquals($expectedResult, $actualResult[2]);
-       }
-
-       /**
-        * Tests whether dayList is correctly calculated for a range of month days
-        *
-        * @test
-        */
-       public function isDayListCorrectForRangeOfDayOfMonth() {
-               if (!t3lib_extMgm::isLoaded('scheduler')) {
-                       $this->markTestSkipped(
-                               'This test only is applicable if the scheduler is installed.'
-                       );
-               }
-
-               $cronCmdInstance = t3lib_div::makeInstance('tx_scheduler_cronCmd', '* * 2-4,10 * *');
-               $expectedResult = array(
-                       '0' => 2,
-                       '1' => 3,
-                       '2' => 4,
-                       '3' => 10,
-               );
-               $actualResult = $cronCmdInstance->valid_values;
-               $this->assertEquals($expectedResult, $actualResult[2]);
-       }
-
-       /**
-        * Tests whether dayList is correctly calculated for a single day of week
-        *
-        * @test
-        */
-       public function isDayListCorrectForOneDayOfWeek() {
-               if (!t3lib_extMgm::isLoaded('scheduler')) {
-                       $this->markTestSkipped(
-                               'This test only is applicable if the scheduler is installed.'
-                       );
-               }
-
-               $cronCmdInstance = t3lib_div::makeInstance('tx_scheduler_cronCmd', '* * * * 1', self::TIMESTAMP);
-               $expectedResult = array(
-                       '0' => 4,
-                       '1' => 11,
-                       '2' => 18,
-                       '3' => 25,
-               );
-               $actualResult = $cronCmdInstance->valid_values;
-               $this->assertEquals($expectedResult, $actualResult[2]);
-       }
-
-       /**
-        * Tests whether dayList is correctly calculated for a combination of day of month and day of weeks
-        *
-        * @test
-        */
-       public function isDayListCorrectForCombinationOfDayOfMonthAndDayOfWeek() {
-               if (!t3lib_extMgm::isLoaded('scheduler')) {
-                       $this->markTestSkipped(
-                               'This test only is applicable if the scheduler is installed.'
-                       );
-               }
-
-               $cronCmdInstance = t3lib_div::makeInstance('tx_scheduler_cronCmd', '* * 1,2 * 1', self::TIMESTAMP);
-               $expectedResult = array(
-                       '0' => 1,
-                       '1' => 2,
-                       '2' => 4,
-                       '3' => 11,
-                       '4' => 18,
-                       '5' => 25,
-               );
-               $actualResult = $cronCmdInstance->valid_values;
-               $this->assertEquals($expectedResult, $actualResult[2]);
-       }
-}
-?>
\ No newline at end of file
diff --git a/typo3/sysext/scheduler/tests/tx_scheduler_croncmd_testcase.php b/typo3/sysext/scheduler/tests/tx_scheduler_croncmd_testcase.php
new file mode 100644 (file)
index 0000000..55c19ae
--- /dev/null
@@ -0,0 +1,121 @@
+<?php
+/***************************************************************
+*  Copyright notice
+*
+*  (c) 2010 Christian Kuhn <lolli@schwarzbu.ch>
+*  All rights reserved
+*
+*  This script is part of the TYPO3 project. The TYPO3 project is
+*  free software; you can redistribute it and/or modify
+*  it under the terms of the GNU General Public License as published by
+*  the Free Software Foundation; either version 2 of the License, or
+*  (at your option) any later version.
+*
+*  The GNU General Public License can be found at
+*  http://www.gnu.org/copyleft/gpl.html.
+*
+*  This script is distributed in the hope that it will be useful,
+*  but WITHOUT ANY WARRANTY; without even the implied warranty of
+*  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+*  GNU General Public License for more details.
+*
+*  This copyright notice MUST APPEAR in all copies of the script!
+***************************************************************/
+
+/**
+ * Testcase for class "tx_scheduler_CronCmd"
+ *
+ * @package TYPO3
+ * @subpackage tx_scheduler
+ *
+ * @author Christian Kuhn <lolli@schwarzbu.ch>
+ */
+class tx_scheduler_croncmd_testcase extends tx_phpunit_testcase {
+       /**
+        * @const       integer timestamp of 1.1.2010 0:00 (Friday)
+        */
+       const TIMESTAMP = 1262300400;
+
+       /**
+        * Tests whether dayList is correctly calculated for a single day of month
+        *
+        * @test
+        */
+       public function isDayListCorrectForOneDayOfMonth() {
+               $cronCmdInstance = t3lib_div::makeInstance('tx_scheduler_cronCmd', '* * 2 * *');
+               $expectedResult = array(
+                       '0' => 2,
+               );
+               $actualResult = $cronCmdInstance->valid_values;
+               $this->assertEquals($expectedResult, $actualResult[2]);
+       }
+
+       /**
+        * Tests whether dayList is correctly calculated for a comma separated list of month days
+        *
+        * @test
+        */
+       public function isDayListCorrectForListOfDayOfMonth() {
+               $cronCmdInstance = t3lib_div::makeInstance('tx_scheduler_cronCmd', '* * 2,7 * *');
+               $expectedResult = array(
+                       '0' => 2,
+                       '1' => 7,
+               );
+               $actualResult = $cronCmdInstance->valid_values;
+               $this->assertEquals($expectedResult, $actualResult[2]);
+       }
+
+       /**
+        * Tests whether dayList is correctly calculated for a range of month days
+        *
+        * @test
+        */
+       public function isDayListCorrectForRangeOfDayOfMonth() {
+               $cronCmdInstance = t3lib_div::makeInstance('tx_scheduler_cronCmd', '* * 2-4,10 * *');
+               $expectedResult = array(
+                       '0' => 2,
+                       '1' => 3,
+                       '2' => 4,
+                       '3' => 10,
+               );
+               $actualResult = $cronCmdInstance->valid_values;
+               $this->assertEquals($expectedResult, $actualResult[2]);
+       }
+
+       /**
+        * Tests whether dayList is correctly calculated for a single day of week
+        *
+        * @test
+        */
+       public function isDayListCorrectForOneDayOfWeek() {
+               $cronCmdInstance = t3lib_div::makeInstance('tx_scheduler_cronCmd', '* * * * 1', self::TIMESTAMP);
+               $expectedResult = array(
+                       '0' => 4,
+                       '1' => 11,
+                       '2' => 18,
+                       '3' => 25,
+               );
+               $actualResult = $cronCmdInstance->valid_values;
+               $this->assertEquals($expectedResult, $actualResult[2]);
+       }
+
+       /**
+        * Tests whether dayList is correctly calculated for a combination of day of month and day of weeks
+        *
+        * @test
+        */
+       public function isDayListCorrectForCombinationOfDayOfMonthAndDayOfWeek() {
+               $cronCmdInstance = t3lib_div::makeInstance('tx_scheduler_cronCmd', '* * 1,2 * 1', self::TIMESTAMP);
+               $expectedResult = array(
+                       '0' => 1,
+                       '1' => 2,
+                       '2' => 4,
+                       '3' => 11,
+                       '4' => 18,
+                       '5' => 25,
+               );
+               $actualResult = $cronCmdInstance->valid_values;
+               $this->assertEquals($expectedResult, $actualResult[2]);
+       }
+}
+?>
\ No newline at end of file