/** * Sets the test up. Prepares a valid fake message */ protected function setUp() { $this->message = new Message(); $fakeStartTime = new DateTime("now", new DateTimeZone("Europe/Berlin")); $requestInformation = new RequestInformation(); $requestInformation->setMethod('GET')->setHeaders(['Accept' => 'Nothing', 'Feels' => 'BadMan'])->setBodyParameters(['action' => 'submit'])->setQueryParameters(['page' => '15', 'offset' => '213123'])->setUrl('my.app.page/products'); $this->message->setAction('MyApp::MyController#MyAction')->setAdditionalData(['stuff' => 'theUserDid'])->setCallerAction('')->setCallerId('')->setDbCalls(12)->setDbTime(123123.123)->setExceptions([new \Exception("Test Exception")])->setHost('my.app.host')->setIp('123.321.123.321')->setRequestId(new RequestId())->setRequestInformation($requestInformation)->setRequestStartedAt($fakeStartTime)->setResponseCode(200)->setSeverity(Expression\Severity::INFO)->setRequestEndedAt($fakeStartTime)->setUserId(0); }
/** * Test if we get the correct default (highest) severity * when there are no lines for whatever reason. */ public function testSeverityOfMessageWithoutLines() { $message = new Message(); $this->assertEquals(Severity::UNKOWN, $message->getSeverity(), "not correct severity"); $message->setSeverityToMax(); $this->assertEquals(Severity::FATAL, $message->getSeverity(), "high severity wasn't converted correctly"); }