Browse Source

Assert log file contains valid string

Ishan Vyas 5 years ago
parent
commit
f6e2690bfc
1 changed files with 4 additions and 0 deletions
  1. 4 0
      tests/TestCase/Utility/LogTest.php

+ 4 - 0
tests/TestCase/Utility/LogTest.php

@@ -39,6 +39,10 @@ class LogTest extends TestCase {
 
 		$this->assertTrue($result);
 		$this->assertFileExists(self::CUSTOM_FILE_PATH);
+		$this->assertRegExp(
+			'/^2[0-9]{3}-[0-9]+-[0-9]+ [0-9]+:[0-9]+:[0-9]+ Debug: It works!/',
+			file_get_contents(self::CUSTOM_FILE_PATH)
+		);
 
 		unlink(self::CUSTOM_FILE_PATH);
 	}