[TASK] Convert log levels from string to integer
[Packages/TYPO3.CMS.git] / typo3 / sysext / core / Tests / Unit / Log / LogLevelTest.php
index 993cf92..08308e8 100644 (file)
@@ -76,6 +76,20 @@ class LevelTest extends \TYPO3\CMS\Core\Tests\UnitTestCase {
                \TYPO3\CMS\Core\Log\LogLevel::validateLevel($inputValue);
        }
 
+       /**
+        * @test
+        */
+       public function normalizeLevelConvertsValidLevelFromStringToInteger() {
+               $this->assertEquals(7, \TYPO3\CMS\Core\Log\LogLevel::normalizeLevel('debug'));
+       }
+
+       /**
+        * @test
+        */
+       public function normalizeLevelDoesNotConvertInvalidLevel() {
+               $levelString = 'invalid';
+               $this->assertEquals($levelString, \TYPO3\CMS\Core\Log\LogLevel::normalizeLevel($levelString));
+       }
 }
 
 ?>
\ No newline at end of file