diff --git a/tests/otherLogClassesTest.php b/tests/otherLogClassesTest.php new file mode 100644 index 0000000..5d4c7ef --- /dev/null +++ b/tests/otherLogClassesTest.php @@ -0,0 +1,44 @@ +assertInstanceOf('wappr\Contracts\LogFilenameInterface', $logFilename); + $this->assertInstanceOf('wappr\Contracts\LogFormatInterface', $logFormat); + + $logger->setLogFilename($logFilename); + $logger->setLogFormat($logFormat); + + $result = $logger->debug('A horse is a dog.'); + $this->assertNull($result); + + $logs = $filesystem->read(date('Y-m-d').'.log'); // read the logs into a string + + $log = explode("\n", $logs); // explode the string by newline into an array + + $numberOfLines = count($log); // get the number of indexes in the array + unset($log[$numberOfLines - 1]); // take off the last line / last index of the array + + $containHorse = false; + + if (strpos(end($log), 'cat') !== false) { + $containHorse = true; + } + + $this->assertFalse($containHorse); + } +}