PKZ[  CommandIsSuccessful.phpnuW+A * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ namespace Symfony\Component\Console\Tester\Constraint; use PHPUnit\Framework\Constraint\Constraint; use Symfony\Component\Console\Command\Command; final class CommandIsSuccessful extends Constraint { public function toString(): string { return 'is successful'; } protected function matches($other): bool { return Command::SUCCESS === $other; } protected function failureDescription($other): string { return 'the command '.$this->toString(); } protected function additionalFailureDescription($other): string { $mapping = [ Command::FAILURE => 'Command failed.', Command::INVALID => 'Command was invalid.', ]; return $mapping[$other] ?? sprintf('Command returned exit status %d.', $other); } } PKZv ResponseCookieValueSame.phpnuW+A * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ namespace Symfony\Component\HttpFoundation\Test\Constraint; use PHPUnit\Framework\Constraint\Constraint; use Symfony\Component\HttpFoundation\Cookie; use Symfony\Component\HttpFoundation\Response; final class ResponseCookieValueSame extends Constraint { private string $name; private string $value; private string $path; private ?string $domain; public function __construct(string $name, string $value, string $path = '/', string $domain = null) { $this->name = $name; $this->value = $value; $this->path = $path; $this->domain = $domain; } public function toString(): string { $str = sprintf('has cookie "%s"', $this->name); if ('/' !== $this->path) { $str .= sprintf(' with path "%s"', $this->path); } if ($this->domain) { $str .= sprintf(' for domain "%s"', $this->domain); } $str .= sprintf(' with value "%s"', $this->value); return $str; } /** * @param Response $response */ protected function matches($response): bool { $cookie = $this->getCookie($response); if (!$cookie) { return false; } return $this->value === (string) $cookie->getValue(); } /** * @param Response $response */ protected function failureDescription($response): string { return 'the Response '.$this->toString(); } protected function getCookie(Response $response): ?Cookie { $cookies = $response->headers->getCookies(); $filteredCookies = array_filter($cookies, fn (Cookie $cookie) => $cookie->getName() === $this->name && $cookie->getPath() === $this->path && $cookie->getDomain() === $this->domain); return reset($filteredCookies) ?: null; } } PKZDu8\ResponseHeaderSame.phpnuW+A * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ namespace Symfony\Component\HttpFoundation\Test\Constraint; use PHPUnit\Framework\Constraint\Constraint; use Symfony\Component\HttpFoundation\Response; final class ResponseHeaderSame extends Constraint { private string $headerName; private string $expectedValue; public function __construct(string $headerName, string $expectedValue) { $this->headerName = $headerName; $this->expectedValue = $expectedValue; } public function toString(): string { return sprintf('has header "%s" with value "%s"', $this->headerName, $this->expectedValue); } /** * @param Response $response */ protected function matches($response): bool { return $this->expectedValue === $response->headers->get($this->headerName, null); } /** * @param Response $response */ protected function failureDescription($response): string { return 'the Response '.$this->toString(); } } PKZTeResponseIsSuccessful.phpnuW+A * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ namespace Symfony\Component\HttpFoundation\Test\Constraint; use PHPUnit\Framework\Constraint\Constraint; use Symfony\Component\HttpFoundation\Response; final class ResponseIsSuccessful extends Constraint { public function toString(): string { return 'is successful'; } /** * @param Response $response */ protected function matches($response): bool { return $response->isSuccessful(); } /** * @param Response $response */ protected function failureDescription($response): string { return 'the Response '.$this->toString(); } /** * @param Response $response */ protected function additionalFailureDescription($response): string { return (string) $response; } } PKZu WResponseIsRedirected.phpnuW+A * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ namespace Symfony\Component\HttpFoundation\Test\Constraint; use PHPUnit\Framework\Constraint\Constraint; use Symfony\Component\HttpFoundation\Response; final class ResponseIsRedirected extends Constraint { public function toString(): string { return 'is redirected'; } /** * @param Response $response */ protected function matches($response): bool { return $response->isRedirect(); } /** * @param Response $response */ protected function failureDescription($response): string { return 'the Response '.$this->toString(); } /** * @param Response $response */ protected function additionalFailureDescription($response): string { return (string) $response; } } PKZ.MResponseStatusCodeSame.phpnuW+A * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ namespace Symfony\Component\HttpFoundation\Test\Constraint; use PHPUnit\Framework\Constraint\Constraint; use Symfony\Component\HttpFoundation\Response; final class ResponseStatusCodeSame extends Constraint { private int $statusCode; public function __construct(int $statusCode) { $this->statusCode = $statusCode; } public function toString(): string { return 'status code is '.$this->statusCode; } /** * @param Response $response */ protected function matches($response): bool { return $this->statusCode === $response->getStatusCode(); } /** * @param Response $response */ protected function failureDescription($response): string { return 'the Response '.$this->toString(); } /** * @param Response $response */ protected function additionalFailureDescription($response): string { return (string) $response; } } PKZ4hhRequestAttributeValueSame.phpnuW+A * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ namespace Symfony\Component\HttpFoundation\Test\Constraint; use PHPUnit\Framework\Constraint\Constraint; use Symfony\Component\HttpFoundation\Request; final class RequestAttributeValueSame extends Constraint { private string $name; private string $value; public function __construct(string $name, string $value) { $this->name = $name; $this->value = $value; } public function toString(): string { return sprintf('has attribute "%s" with value "%s"', $this->name, $this->value); } /** * @param Request $request */ protected function matches($request): bool { return $this->value === $request->attributes->get($this->name); } /** * @param Request $request */ protected function failureDescription($request): string { return 'the Request '.$this->toString(); } } PKZDDResponseHasHeader.phpnuW+A * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ namespace Symfony\Component\HttpFoundation\Test\Constraint; use PHPUnit\Framework\Constraint\Constraint; use Symfony\Component\HttpFoundation\Response; final class ResponseHasHeader extends Constraint { private string $headerName; public function __construct(string $headerName) { $this->headerName = $headerName; } public function toString(): string { return sprintf('has header "%s"', $this->headerName); } /** * @param Response $response */ protected function matches($response): bool { return $response->headers->has($this->headerName); } /** * @param Response $response */ protected function failureDescription($response): string { return 'the Response '.$this->toString(); } } PKZ?[DResponseIsUnprocessable.phpnuW+A * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ namespace Symfony\Component\HttpFoundation\Test\Constraint; use PHPUnit\Framework\Constraint\Constraint; use Symfony\Component\HttpFoundation\Response; final class ResponseIsUnprocessable extends Constraint { public function toString(): string { return 'is unprocessable'; } /** * @param Response $other */ protected function matches($other): bool { return Response::HTTP_UNPROCESSABLE_ENTITY === $other->getStatusCode(); } /** * @param Response $other */ protected function failureDescription($other): string { return 'the Response '.$this->toString(); } /** * @param Response $other */ protected function additionalFailureDescription($other): string { return (string) $other; } } PKZ7uJI  ResponseHasCookie.phpnuW+A * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ namespace Symfony\Component\HttpFoundation\Test\Constraint; use PHPUnit\Framework\Constraint\Constraint; use Symfony\Component\HttpFoundation\Cookie; use Symfony\Component\HttpFoundation\Response; final class ResponseHasCookie extends Constraint { private string $name; private string $path; private ?string $domain; public function __construct(string $name, string $path = '/', string $domain = null) { $this->name = $name; $this->path = $path; $this->domain = $domain; } public function toString(): string { $str = sprintf('has cookie "%s"', $this->name); if ('/' !== $this->path) { $str .= sprintf(' with path "%s"', $this->path); } if ($this->domain) { $str .= sprintf(' for domain "%s"', $this->domain); } return $str; } /** * @param Response $response */ protected function matches($response): bool { return null !== $this->getCookie($response); } /** * @param Response $response */ protected function failureDescription($response): string { return 'the Response '.$this->toString(); } private function getCookie(Response $response): ?Cookie { $cookies = $response->headers->getCookies(); $filteredCookies = array_filter($cookies, fn (Cookie $cookie) => $cookie->getName() === $this->name && $cookie->getPath() === $this->path && $cookie->getDomain() === $this->domain); return reset($filteredCookies) ?: null; } } PKZ|'ResponseFormatSame.phpnuW+A * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ namespace Symfony\Component\HttpFoundation\Test\Constraint; use PHPUnit\Framework\Constraint\Constraint; use Symfony\Component\HttpFoundation\Request; use Symfony\Component\HttpFoundation\Response; /** * Asserts that the response is in the given format. * * @author Kévin Dunglas */ final class ResponseFormatSame extends Constraint { private Request $request; private ?string $format; public function __construct(Request $request, ?string $format) { $this->request = $request; $this->format = $format; } public function toString(): string { return 'format is '.($this->format ?? 'null'); } /** * @param Response $response */ protected function matches($response): bool { return $this->format === $this->request->getFormat($response->headers->get('Content-Type')); } /** * @param Response $response */ protected function failureDescription($response): string { return 'the Response '.$this->toString(); } /** * @param Response $response */ protected function additionalFailureDescription($response): string { return (string) $response; } } PKZ[  CommandIsSuccessful.phpnuW+APKZv gResponseCookieValueSame.phpnuW+APKZDu8\ ResponseHeaderSame.phpnuW+APKZTeResponseIsSuccessful.phpnuW+APKZu W ResponseIsRedirected.phpnuW+APKZ.MRResponseStatusCodeSame.phpnuW+APKZ4hhNRequestAttributeValueSame.phpnuW+APKZDD$ResponseHasHeader.phpnuW+APKZ?[DW(ResponseIsUnprocessable.phpnuW+APKZ7uJI  ,ResponseHasCookie.phpnuW+APKZ|' 4ResponseFormatSame.phpnuW+APK  :