[TASK] Fix wrong named unit tests of the logging framework 82/31782/5
authorSascha Egerer <sascha.egerer@dkd.de>
Thu, 24 Jul 2014 20:50:44 +0000 (22:50 +0200)
committerAnja Leichsenring <aleichsenring@ab-softlab.de>
Fri, 25 Jul 2014 12:22:49 +0000 (14:22 +0200)
Most of the unit tests for the logging framework have a
wrong filename and also a wrong classname.

Resolves: #60547
Releases: 6.3, 6.2
Change-Id: I5aaad54566bd33a9caf0d665655d9cb0f4552119
Reviewed-on: http://review.typo3.org/31782
Reviewed-by: Christian Kuhn <lolli@schwarzbu.ch>
Tested-by: Christian Kuhn <lolli@schwarzbu.ch>
Reviewed-by: Anja Leichsenring <aleichsenring@ab-softlab.de>
Tested-by: Anja Leichsenring <aleichsenring@ab-softlab.de>
14 files changed:
typo3/sysext/core/Tests/Unit/Log/LogLevelTest.php
typo3/sysext/core/Tests/Unit/Log/LogManagerTest.php
typo3/sysext/core/Tests/Unit/Log/LogRecordTest.php
typo3/sysext/core/Tests/Unit/Log/LoggerTest.php
typo3/sysext/core/Tests/Unit/Log/Processor/AbstractMemoryTest.php
typo3/sysext/core/Tests/Unit/Log/Processor/AbstractProcessorTest.php [new file with mode: 0644]
typo3/sysext/core/Tests/Unit/Log/Processor/AbstractTest.php [deleted file]
typo3/sysext/core/Tests/Unit/Log/Processor/MemoryPeakUsageProcessorTest.php [new file with mode: 0644]
typo3/sysext/core/Tests/Unit/Log/Processor/MemoryPeakUsageTest.php [deleted file]
typo3/sysext/core/Tests/Unit/Log/Processor/MemoryUsageProcessorTest.php [new file with mode: 0644]
typo3/sysext/core/Tests/Unit/Log/Processor/MemoryUsageTest.php [deleted file]
typo3/sysext/core/Tests/Unit/Log/Processor/ProcessorTest.php [deleted file]
typo3/sysext/core/Tests/Unit/Log/Processor/WebProcessorTest.php [new file with mode: 0644]
typo3/sysext/core/Tests/Unit/Log/Processor/WebTest.php [deleted file]

index e4e61f8..5c10c55 100644 (file)
@@ -15,11 +15,11 @@ namespace TYPO3\CMS\Core\Tests\Unit\Log;
  */
 
 /**
- * Testcase for \TYPO3\CMS\Core\Log\Level.
+ * Test case
  *
  * @author Ingo Renner <ingo@typo3.org>
  */
-class LevelTest extends \TYPO3\CMS\Core\Tests\UnitTestCase {
+class LogLevelTest extends \TYPO3\CMS\Core\Tests\UnitTestCase {
 
        /**
         * @test
index 04184f6..3e9ecfe 100644 (file)
@@ -15,7 +15,7 @@ namespace TYPO3\CMS\Core\Tests\Unit\Log;
  */
 
 /**
- * Testcase for \TYPO3\CMS\Core\Log\LogManager.
+ * Test case
  *
  * @author Ingo Renner <ingo@typo3.org>
  * @author Steffen Gebert <steffen.gebert@typo3.org>
index 9ef2a61..975d74e 100644 (file)
@@ -15,11 +15,11 @@ namespace TYPO3\CMS\Core\Tests\Unit\Log;
  */
 
 /**
- * Testcase for \TYPO3\CMS\Core\Log\LogRecord.
+ * Test case
  *
  * @author Steffen Gebert <steffen.gebert@typo3.org>
  */
-class RecordTest extends \TYPO3\CMS\Core\Tests\UnitTestCase {
+class LogRecordTest extends \TYPO3\CMS\Core\Tests\UnitTestCase {
 
        /**
         * Returns a \TYPO3\CMS\Core\Log\LogRecord
index 300779e..8299029 100644 (file)
@@ -15,7 +15,7 @@ namespace TYPO3\CMS\Core\Tests\Unit\Log;
  */
 
 /**
- * Testcase for \TYPO3\CMS\Core\Log\Logger.
+ * Test case
  *
  * @author Ingo Renner <ingo@typo3.org>
  * @author Steffen Gebert <steffen.gebert@typo3.org>
index 60a3186..d613a39 100644 (file)
@@ -15,11 +15,11 @@ namespace TYPO3\CMS\Core\Tests\Unit\Log\Processor;
  */
 
 /**
- * Testcase for \TYPO3\CMS\Core\Log\Processor\AbstractMemoryProcessor
+ * Test case
  *
  * @author Steffen Müller <typo3@t3node.com>
  */
-class AbstractMemoryTest extends \TYPO3\CMS\Core\Tests\UnitTestCase {
+class AbstractMemoryProcessorTest extends \TYPO3\CMS\Core\Tests\UnitTestCase {
 
        /**
         * @test
diff --git a/typo3/sysext/core/Tests/Unit/Log/Processor/AbstractProcessorTest.php b/typo3/sysext/core/Tests/Unit/Log/Processor/AbstractProcessorTest.php
new file mode 100644 (file)
index 0000000..595469d
--- /dev/null
@@ -0,0 +1,50 @@
+<?php
+namespace TYPO3\CMS\Core\Tests\Unit\Log\Processor;
+
+/**
+ * This file is part of the TYPO3 CMS project.
+ *
+ * It is free software; you can redistribute it and/or modify it under
+ * the terms of the GNU General Public License, either version 2
+ * of the License, or any later version.
+ *
+ * For the full copyright and license information, please read the
+ * LICENSE.txt file that was distributed with this source code.
+ *
+ * The TYPO3 project - inspiring people to share!
+ */
+
+/**
+ * Test case
+ *
+ * @author Steffen Müller <typo3@t3node.com>
+ */
+class AbstractProcessorTest extends \TYPO3\CMS\Core\Tests\UnitTestCase {
+
+       /**
+        * @test
+        * @expectedException \InvalidArgumentException
+        */
+       public function processorRefusesInvalidConfigurationOptions() {
+               $invalidConfiguration = array(
+                       'foo' => 'bar'
+               );
+               $processor = \TYPO3\CMS\Core\Utility\GeneralUtility::makeInstance('TYPO3\\CMS\\Core\\Tests\\Unit\\Log\\Fixtures\\ProcessorFixture', $invalidConfiguration);
+       }
+
+       /**
+        * @test
+        */
+       public function loggerExecutesProcessors() {
+               $logger = new \TYPO3\CMS\Core\Log\Logger('test.core.log');
+               $writer = new \TYPO3\CMS\Core\Log\Writer\NullWriter();
+               $level = \TYPO3\CMS\Core\Log\LogLevel::DEBUG;
+               $logRecord = new \TYPO3\CMS\Core\Log\LogRecord('dummy', $level, 'message');
+               $processor = $this->getMock('\\TYPO3\\CMS\\Core\\Log\\Processor\\ProcessorInterface', array('processLogRecord'));
+               $processor->expects($this->once())->method('processLogRecord')->willReturn($logRecord);
+
+               $logger->addWriter($level, $writer);
+               $logger->addProcessor($level, $processor);
+               $logger->warning('test');
+       }
+}
diff --git a/typo3/sysext/core/Tests/Unit/Log/Processor/AbstractTest.php b/typo3/sysext/core/Tests/Unit/Log/Processor/AbstractTest.php
deleted file mode 100644 (file)
index 1d57b80..0000000
+++ /dev/null
@@ -1,35 +0,0 @@
-<?php
-namespace TYPO3\CMS\Core\Tests\Unit\Log\Processor;
-
-/**
- * This file is part of the TYPO3 CMS project.
- *
- * It is free software; you can redistribute it and/or modify it under
- * the terms of the GNU General Public License, either version 2
- * of the License, or any later version.
- *
- * For the full copyright and license information, please read the
- * LICENSE.txt file that was distributed with this source code.
- *
- * The TYPO3 project - inspiring people to share!
- */
-
-/**
- * Testcase for \TYPO3\CMS\Core\Log\Processor\Abstract
- *
- * @author Steffen Müller <typo3@t3node.com>
- */
-class AbstractTest extends \TYPO3\CMS\Core\Tests\UnitTestCase {
-
-       /**
-        * @test
-        * @expectedException \InvalidArgumentException
-        */
-       public function processorRefusesInvalidConfigurationOptions() {
-               $invalidConfiguration = array(
-                       'foo' => 'bar'
-               );
-               $processor = \TYPO3\CMS\Core\Utility\GeneralUtility::makeInstance('TYPO3\\CMS\\Core\\Tests\\Unit\\Log\\Fixtures\\ProcessorFixture', $invalidConfiguration);
-       }
-
-}
diff --git a/typo3/sysext/core/Tests/Unit/Log/Processor/MemoryPeakUsageProcessorTest.php b/typo3/sysext/core/Tests/Unit/Log/Processor/MemoryPeakUsageProcessorTest.php
new file mode 100644 (file)
index 0000000..79ce7f3
--- /dev/null
@@ -0,0 +1,34 @@
+<?php
+namespace TYPO3\CMS\Core\Tests\Unit\Log\Processor;
+
+/**
+ * This file is part of the TYPO3 CMS project.
+ *
+ * It is free software; you can redistribute it and/or modify it under
+ * the terms of the GNU General Public License, either version 2
+ * of the License, or any later version.
+ *
+ * For the full copyright and license information, please read the
+ * LICENSE.txt file that was distributed with this source code.
+ *
+ * The TYPO3 project - inspiring people to share!
+ */
+
+/**
+ * Test case
+ *
+ * @author Steffen Müller <typo3@t3node.com>
+ */
+class MemoryPeakUsageProcessorTest extends \TYPO3\CMS\Core\Tests\UnitTestCase {
+
+       /**
+        * @test
+        */
+       public function memoryPeakUsagePRocessorAddsMemoryPeakUsageDataToLogRecord() {
+               $logRecord = new \TYPO3\CMS\Core\Log\LogRecord('test.core.log', \TYPO3\CMS\Core\Log\LogLevel::DEBUG, 'test');
+               $processor = new \TYPO3\CMS\Core\Log\Processor\MemoryPeakUsageProcessor();
+               $logRecord = $processor->processLogRecord($logRecord);
+               $this->assertArrayHasKey('memoryPeakUsage', $logRecord['data']);
+       }
+
+}
diff --git a/typo3/sysext/core/Tests/Unit/Log/Processor/MemoryPeakUsageTest.php b/typo3/sysext/core/Tests/Unit/Log/Processor/MemoryPeakUsageTest.php
deleted file mode 100644 (file)
index e8171b5..0000000
+++ /dev/null
@@ -1,34 +0,0 @@
-<?php
-namespace TYPO3\CMS\Core\Tests\Unit\Log\Processor;
-
-/**
- * This file is part of the TYPO3 CMS project.
- *
- * It is free software; you can redistribute it and/or modify it under
- * the terms of the GNU General Public License, either version 2
- * of the License, or any later version.
- *
- * For the full copyright and license information, please read the
- * LICENSE.txt file that was distributed with this source code.
- *
- * The TYPO3 project - inspiring people to share!
- */
-
-/**
- * Testcase for the memoryPeakUsage log processor.
- *
- * @author Steffen Müller <typo3@t3node.com>
- */
-class MemoryPeakUsageTest extends \TYPO3\CMS\Core\Tests\UnitTestCase {
-
-       /**
-        * @test
-        */
-       public function memoryPeakUsagePRocessorAddsMemoryPeakUsageDataToLogRecord() {
-               $logRecord = new \TYPO3\CMS\Core\Log\LogRecord('test.core.log', \TYPO3\CMS\Core\Log\LogLevel::DEBUG, 'test');
-               $processor = new \TYPO3\CMS\Core\Log\Processor\MemoryPeakUsageProcessor();
-               $logRecord = $processor->processLogRecord($logRecord);
-               $this->assertArrayHasKey('memoryPeakUsage', $logRecord['data']);
-       }
-
-}
diff --git a/typo3/sysext/core/Tests/Unit/Log/Processor/MemoryUsageProcessorTest.php b/typo3/sysext/core/Tests/Unit/Log/Processor/MemoryUsageProcessorTest.php
new file mode 100644 (file)
index 0000000..98018e7
--- /dev/null
@@ -0,0 +1,34 @@
+<?php
+namespace TYPO3\CMS\Core\Tests\Unit\Log\Processor;
+
+/**
+ * This file is part of the TYPO3 CMS project.
+ *
+ * It is free software; you can redistribute it and/or modify it under
+ * the terms of the GNU General Public License, either version 2
+ * of the License, or any later version.
+ *
+ * For the full copyright and license information, please read the
+ * LICENSE.txt file that was distributed with this source code.
+ *
+ * The TYPO3 project - inspiring people to share!
+ */
+
+/**
+ * Test case
+ *
+ * @author Steffen Müller <typo3@t3node.com>
+ */
+class MemoryUsageProcessorTest extends \TYPO3\CMS\Core\Tests\UnitTestCase {
+
+       /**
+        * @test
+        */
+       public function memoryUsagePRocessorAddsMemoryUsageDataToLogRecord() {
+               $logRecord = new \TYPO3\CMS\Core\Log\LogRecord('test.core.log', \TYPO3\CMS\Core\Log\LogLevel::DEBUG, 'test');
+               $processor = new \TYPO3\CMS\Core\Log\Processor\MemoryUsageProcessor();
+               $logRecord = $processor->processLogRecord($logRecord);
+               $this->assertArrayHasKey('memoryUsage', $logRecord['data']);
+       }
+
+}
diff --git a/typo3/sysext/core/Tests/Unit/Log/Processor/MemoryUsageTest.php b/typo3/sysext/core/Tests/Unit/Log/Processor/MemoryUsageTest.php
deleted file mode 100644 (file)
index 46e893c..0000000
+++ /dev/null
@@ -1,34 +0,0 @@
-<?php
-namespace TYPO3\CMS\Core\Tests\Unit\Log\Processor;
-
-/**
- * This file is part of the TYPO3 CMS project.
- *
- * It is free software; you can redistribute it and/or modify it under
- * the terms of the GNU General Public License, either version 2
- * of the License, or any later version.
- *
- * For the full copyright and license information, please read the
- * LICENSE.txt file that was distributed with this source code.
- *
- * The TYPO3 project - inspiring people to share!
- */
-
-/**
- * Testcase for the memoryUsage log processor.
- *
- * @author Steffen Müller <typo3@t3node.com>
- */
-class MemoryUsageTest extends \TYPO3\CMS\Core\Tests\UnitTestCase {
-
-       /**
-        * @test
-        */
-       public function memoryUsagePRocessorAddsMemoryUsageDataToLogRecord() {
-               $logRecord = new \TYPO3\CMS\Core\Log\LogRecord('test.core.log', \TYPO3\CMS\Core\Log\LogLevel::DEBUG, 'test');
-               $processor = new \TYPO3\CMS\Core\Log\Processor\MemoryUsageProcessor();
-               $logRecord = $processor->processLogRecord($logRecord);
-               $this->assertArrayHasKey('memoryUsage', $logRecord['data']);
-       }
-
-}
diff --git a/typo3/sysext/core/Tests/Unit/Log/Processor/ProcessorTest.php b/typo3/sysext/core/Tests/Unit/Log/Processor/ProcessorTest.php
deleted file mode 100644 (file)
index c701adb..0000000
+++ /dev/null
@@ -1,53 +0,0 @@
-<?php
-namespace TYPO3\CMS\Core\Tests\Unit\Log\Processor;
-
-/**
- * This file is part of the TYPO3 CMS project.
- *
- * It is free software; you can redistribute it and/or modify it under
- * the terms of the GNU General Public License, either version 2
- * of the License, or any later version.
- *
- * For the full copyright and license information, please read the
- * LICENSE.txt file that was distributed with this source code.
- *
- * The TYPO3 project - inspiring people to share!
- */
-
-/**
- * Testcase for log processors.
- *
- * @author Ingo Renner <ingo@typo3.org>
- */
-class ProcessorTest extends \TYPO3\CMS\Core\Tests\UnitTestCase implements \TYPO3\CMS\Core\Log\Processor\ProcessorInterface {
-
-       /**
-        * @var bool
-        */
-       public $processorCalled = FALSE;
-
-       /**
-        * Processes a log record and adds server data.
-        *
-        * @param \TYPO3\CMS\Core\Log\LogRecord $logRecord The log record to process
-        * @return \TYPO3\CMS\Core\Log\LogRecord The processed log record with addtional data
-        */
-       public function processLogRecord(\TYPO3\CMS\Core\Log\LogRecord $logRecord) {
-               $this->processorCalled = TRUE;
-               return $logRecord;
-       }
-
-       /**
-        * @test
-        */
-       public function loggerExecutesProcessors() {
-               $logger = new \TYPO3\CMS\Core\Log\Logger('test.core.log');
-               $writer = new \TYPO3\CMS\Core\Log\Writer\NullWriter();
-               $level = \TYPO3\CMS\Core\Log\LogLevel::DEBUG;
-               $logger->addWriter($level, $writer);
-               $logger->addProcessor($level, $this);
-               $logger->warning('test');
-               $this->assertTrue($this->processorCalled);
-       }
-
-}
diff --git a/typo3/sysext/core/Tests/Unit/Log/Processor/WebProcessorTest.php b/typo3/sysext/core/Tests/Unit/Log/Processor/WebProcessorTest.php
new file mode 100644 (file)
index 0000000..f2f46f0
--- /dev/null
@@ -0,0 +1,38 @@
+<?php
+namespace TYPO3\CMS\Core\Tests\Unit\Log\Processor;
+
+/**
+ * This file is part of the TYPO3 CMS project.
+ *
+ * It is free software; you can redistribute it and/or modify it under
+ * the terms of the GNU General Public License, either version 2
+ * of the License, or any later version.
+ *
+ * For the full copyright and license information, please read the
+ * LICENSE.txt file that was distributed with this source code.
+ *
+ * The TYPO3 project - inspiring people to share!
+ */
+
+/**
+ * Test case
+ *
+ * @author Ingo Renner <ingo@typo3.org>
+ * @author Steffen Müller <typo3@t3node.com>
+ */
+class WebProcessorTest extends \TYPO3\CMS\Core\Tests\UnitTestCase {
+
+       /**
+        * @test
+        */
+       public function webProcessorAddsWebDataToLogRecord() {
+               $environmentVariables = \TYPO3\CMS\Core\Utility\GeneralUtility::getIndpEnv('_ARRAY');
+               $logRecord = new \TYPO3\CMS\Core\Log\LogRecord('test.core.log', \TYPO3\CMS\Core\Log\LogLevel::DEBUG, 'test');
+               $processor = new \TYPO3\CMS\Core\Log\Processor\WebProcessor();
+               $logRecord = $processor->processLogRecord($logRecord);
+               foreach ($environmentVariables as $key => $value) {
+                       $this->assertEquals($value, $logRecord['data'][$key]);
+               }
+       }
+
+}
diff --git a/typo3/sysext/core/Tests/Unit/Log/Processor/WebTest.php b/typo3/sysext/core/Tests/Unit/Log/Processor/WebTest.php
deleted file mode 100644 (file)
index 6ad446d..0000000
+++ /dev/null
@@ -1,38 +0,0 @@
-<?php
-namespace TYPO3\CMS\Core\Tests\Unit\Log\Processor;
-
-/**
- * This file is part of the TYPO3 CMS project.
- *
- * It is free software; you can redistribute it and/or modify it under
- * the terms of the GNU General Public License, either version 2
- * of the License, or any later version.
- *
- * For the full copyright and license information, please read the
- * LICENSE.txt file that was distributed with this source code.
- *
- * The TYPO3 project - inspiring people to share!
- */
-
-/**
- * Testcase for the web log processor.
- *
- * @author Ingo Renner <ingo@typo3.org>
- * @author Steffen Müller <typo3@t3node.com>
- */
-class WebTest extends \TYPO3\CMS\Core\Tests\UnitTestCase {
-
-       /**
-        * @test
-        */
-       public function webProcessorAddsWebDataToLogRecord() {
-               $environmentVariables = \TYPO3\CMS\Core\Utility\GeneralUtility::getIndpEnv('_ARRAY');
-               $logRecord = new \TYPO3\CMS\Core\Log\LogRecord('test.core.log', \TYPO3\CMS\Core\Log\LogLevel::DEBUG, 'test');
-               $processor = new \TYPO3\CMS\Core\Log\Processor\WebProcessor();
-               $logRecord = $processor->processLogRecord($logRecord);
-               foreach ($environmentVariables as $key => $value) {
-                       $this->assertEquals($value, $logRecord['data'][$key]);
-               }
-       }
-
-}