client = self::createClient(); } public function testChangePasswordRedirectsToSettings(): void { $this->client->request(Request::METHOD_GET, '/.well-known/change-password'); self::assertResponseRedirects('/backoffice/settings'); } /** @throws \Exception */ public function testSecurityTxt(): void { $this->client->request(Request::METHOD_GET, '/.well-known/security.txt'); self::assertResponseIsSuccessful(); self::assertResponseHeaderSame('Content-Type', 'text/plain; charset=UTF-8'); $content = (string) $this->client->getResponse()->getContent(); $this->assertStringContainsString('Contact:', $content); $this->assertMatchesRegularExpression('/^Expires: (.+)$/m', $content); \Safe\preg_match('/^Expires: (.+)$/m', $content, $matches); $this->assertArrayHasKey(1, $matches); $expires = new DateTimeImmutable($matches[1]); $this->assertGreaterThan(new DateTimeImmutable('now'), $expires); } }