/** * Running testLogError(). * * @return void */ public function testLogError() { $this->object->logError("I'm a message with a tricky\nnew line."); $log_file_contents = file_get_contents($this->log_path_errors); $this->assertLogFormat($log_file_contents); // Checking that message is entirely saved and new lines are escaped. $this->assertContains("I'm a message with a tricky\\nnew line.", $log_file_contents); $this->assertContains("[ERROR]", $log_file_contents); }