expectException(BadRequestException::class); DI::session()->set('uid', ''); Notification::rawContent(); } public function testWithoutAuthenticatedUser() { self::markTestIncomplete('Needs BasicAuth as dynamic method for overriding first'); $this->expectException(BadRequestException::class); DI::session()->set('uid', 41); Notification::rawContent(); } public function testWithXmlResult() { $date = DateTimeFormat::local('2020-01-01 12:12:02'); $dateRel = Temporal::getRelativeDate('2020-01-01 07:12:02'); $assertXml = << XML; Notification::rawContent(['extension' => 'xml']); self::assertXmlStringEqualsXmlString($assertXml, ApiResponseDouble::getOutput()); } public function testWithJsonResult() { Notification::rawContent(['parameter' => 'json']); $result = json_encode(ApiResponseDouble::getOutput()); self::assertJson($result); } }