package and depencies
This commit is contained in:
@@ -16,8 +16,8 @@ use Symfony\Component\HttpFoundation\Request;
|
||||
|
||||
final class RequestAttributeValueSame extends Constraint
|
||||
{
|
||||
private $name;
|
||||
private $value;
|
||||
private string $name;
|
||||
private string $value;
|
||||
|
||||
public function __construct(string $name, string $value)
|
||||
{
|
||||
@@ -25,9 +25,6 @@ final class RequestAttributeValueSame extends Constraint
|
||||
$this->value = $value;
|
||||
}
|
||||
|
||||
/**
|
||||
* {@inheritdoc}
|
||||
*/
|
||||
public function toString(): string
|
||||
{
|
||||
return sprintf('has attribute "%s" with value "%s"', $this->name, $this->value);
|
||||
@@ -35,8 +32,6 @@ final class RequestAttributeValueSame extends Constraint
|
||||
|
||||
/**
|
||||
* @param Request $request
|
||||
*
|
||||
* {@inheritdoc}
|
||||
*/
|
||||
protected function matches($request): bool
|
||||
{
|
||||
@@ -45,8 +40,6 @@ final class RequestAttributeValueSame extends Constraint
|
||||
|
||||
/**
|
||||
* @param Request $request
|
||||
*
|
||||
* {@inheritdoc}
|
||||
*/
|
||||
protected function failureDescription($request): string
|
||||
{
|
||||
|
@@ -17,10 +17,10 @@ use Symfony\Component\HttpFoundation\Response;
|
||||
|
||||
final class ResponseCookieValueSame extends Constraint
|
||||
{
|
||||
private $name;
|
||||
private $value;
|
||||
private $path;
|
||||
private $domain;
|
||||
private string $name;
|
||||
private string $value;
|
||||
private string $path;
|
||||
private ?string $domain;
|
||||
|
||||
public function __construct(string $name, string $value, string $path = '/', string $domain = null)
|
||||
{
|
||||
@@ -30,9 +30,6 @@ final class ResponseCookieValueSame extends Constraint
|
||||
$this->domain = $domain;
|
||||
}
|
||||
|
||||
/**
|
||||
* {@inheritdoc}
|
||||
*/
|
||||
public function toString(): string
|
||||
{
|
||||
$str = sprintf('has cookie "%s"', $this->name);
|
||||
@@ -49,8 +46,6 @@ final class ResponseCookieValueSame extends Constraint
|
||||
|
||||
/**
|
||||
* @param Response $response
|
||||
*
|
||||
* {@inheritdoc}
|
||||
*/
|
||||
protected function matches($response): bool
|
||||
{
|
||||
@@ -64,8 +59,6 @@ final class ResponseCookieValueSame extends Constraint
|
||||
|
||||
/**
|
||||
* @param Response $response
|
||||
*
|
||||
* {@inheritdoc}
|
||||
*/
|
||||
protected function failureDescription($response): string
|
||||
{
|
||||
|
@@ -22,8 +22,8 @@ use Symfony\Component\HttpFoundation\Response;
|
||||
*/
|
||||
final class ResponseFormatSame extends Constraint
|
||||
{
|
||||
private $request;
|
||||
private $format;
|
||||
private Request $request;
|
||||
private ?string $format;
|
||||
|
||||
public function __construct(Request $request, ?string $format)
|
||||
{
|
||||
@@ -31,9 +31,6 @@ final class ResponseFormatSame extends Constraint
|
||||
$this->format = $format;
|
||||
}
|
||||
|
||||
/**
|
||||
* {@inheritdoc}
|
||||
*/
|
||||
public function toString(): string
|
||||
{
|
||||
return 'format is '.($this->format ?? 'null');
|
||||
@@ -41,8 +38,6 @@ final class ResponseFormatSame extends Constraint
|
||||
|
||||
/**
|
||||
* @param Response $response
|
||||
*
|
||||
* {@inheritdoc}
|
||||
*/
|
||||
protected function matches($response): bool
|
||||
{
|
||||
@@ -51,8 +46,6 @@ final class ResponseFormatSame extends Constraint
|
||||
|
||||
/**
|
||||
* @param Response $response
|
||||
*
|
||||
* {@inheritdoc}
|
||||
*/
|
||||
protected function failureDescription($response): string
|
||||
{
|
||||
@@ -61,8 +54,6 @@ final class ResponseFormatSame extends Constraint
|
||||
|
||||
/**
|
||||
* @param Response $response
|
||||
*
|
||||
* {@inheritdoc}
|
||||
*/
|
||||
protected function additionalFailureDescription($response): string
|
||||
{
|
||||
|
@@ -17,9 +17,9 @@ use Symfony\Component\HttpFoundation\Response;
|
||||
|
||||
final class ResponseHasCookie extends Constraint
|
||||
{
|
||||
private $name;
|
||||
private $path;
|
||||
private $domain;
|
||||
private string $name;
|
||||
private string $path;
|
||||
private ?string $domain;
|
||||
|
||||
public function __construct(string $name, string $path = '/', string $domain = null)
|
||||
{
|
||||
@@ -28,9 +28,6 @@ final class ResponseHasCookie extends Constraint
|
||||
$this->domain = $domain;
|
||||
}
|
||||
|
||||
/**
|
||||
* {@inheritdoc}
|
||||
*/
|
||||
public function toString(): string
|
||||
{
|
||||
$str = sprintf('has cookie "%s"', $this->name);
|
||||
@@ -46,8 +43,6 @@ final class ResponseHasCookie extends Constraint
|
||||
|
||||
/**
|
||||
* @param Response $response
|
||||
*
|
||||
* {@inheritdoc}
|
||||
*/
|
||||
protected function matches($response): bool
|
||||
{
|
||||
@@ -56,8 +51,6 @@ final class ResponseHasCookie extends Constraint
|
||||
|
||||
/**
|
||||
* @param Response $response
|
||||
*
|
||||
* {@inheritdoc}
|
||||
*/
|
||||
protected function failureDescription($response): string
|
||||
{
|
||||
|
@@ -16,16 +16,13 @@ use Symfony\Component\HttpFoundation\Response;
|
||||
|
||||
final class ResponseHasHeader extends Constraint
|
||||
{
|
||||
private $headerName;
|
||||
private string $headerName;
|
||||
|
||||
public function __construct(string $headerName)
|
||||
{
|
||||
$this->headerName = $headerName;
|
||||
}
|
||||
|
||||
/**
|
||||
* {@inheritdoc}
|
||||
*/
|
||||
public function toString(): string
|
||||
{
|
||||
return sprintf('has header "%s"', $this->headerName);
|
||||
@@ -33,8 +30,6 @@ final class ResponseHasHeader extends Constraint
|
||||
|
||||
/**
|
||||
* @param Response $response
|
||||
*
|
||||
* {@inheritdoc}
|
||||
*/
|
||||
protected function matches($response): bool
|
||||
{
|
||||
@@ -43,8 +38,6 @@ final class ResponseHasHeader extends Constraint
|
||||
|
||||
/**
|
||||
* @param Response $response
|
||||
*
|
||||
* {@inheritdoc}
|
||||
*/
|
||||
protected function failureDescription($response): string
|
||||
{
|
||||
|
@@ -16,8 +16,8 @@ use Symfony\Component\HttpFoundation\Response;
|
||||
|
||||
final class ResponseHeaderSame extends Constraint
|
||||
{
|
||||
private $headerName;
|
||||
private $expectedValue;
|
||||
private string $headerName;
|
||||
private string $expectedValue;
|
||||
|
||||
public function __construct(string $headerName, string $expectedValue)
|
||||
{
|
||||
@@ -25,9 +25,6 @@ final class ResponseHeaderSame extends Constraint
|
||||
$this->expectedValue = $expectedValue;
|
||||
}
|
||||
|
||||
/**
|
||||
* {@inheritdoc}
|
||||
*/
|
||||
public function toString(): string
|
||||
{
|
||||
return sprintf('has header "%s" with value "%s"', $this->headerName, $this->expectedValue);
|
||||
@@ -35,8 +32,6 @@ final class ResponseHeaderSame extends Constraint
|
||||
|
||||
/**
|
||||
* @param Response $response
|
||||
*
|
||||
* {@inheritdoc}
|
||||
*/
|
||||
protected function matches($response): bool
|
||||
{
|
||||
@@ -45,8 +40,6 @@ final class ResponseHeaderSame extends Constraint
|
||||
|
||||
/**
|
||||
* @param Response $response
|
||||
*
|
||||
* {@inheritdoc}
|
||||
*/
|
||||
protected function failureDescription($response): string
|
||||
{
|
||||
|
@@ -16,9 +16,6 @@ use Symfony\Component\HttpFoundation\Response;
|
||||
|
||||
final class ResponseIsRedirected extends Constraint
|
||||
{
|
||||
/**
|
||||
* {@inheritdoc}
|
||||
*/
|
||||
public function toString(): string
|
||||
{
|
||||
return 'is redirected';
|
||||
@@ -26,8 +23,6 @@ final class ResponseIsRedirected extends Constraint
|
||||
|
||||
/**
|
||||
* @param Response $response
|
||||
*
|
||||
* {@inheritdoc}
|
||||
*/
|
||||
protected function matches($response): bool
|
||||
{
|
||||
@@ -36,8 +31,6 @@ final class ResponseIsRedirected extends Constraint
|
||||
|
||||
/**
|
||||
* @param Response $response
|
||||
*
|
||||
* {@inheritdoc}
|
||||
*/
|
||||
protected function failureDescription($response): string
|
||||
{
|
||||
@@ -46,8 +39,6 @@ final class ResponseIsRedirected extends Constraint
|
||||
|
||||
/**
|
||||
* @param Response $response
|
||||
*
|
||||
* {@inheritdoc}
|
||||
*/
|
||||
protected function additionalFailureDescription($response): string
|
||||
{
|
||||
|
@@ -16,9 +16,6 @@ use Symfony\Component\HttpFoundation\Response;
|
||||
|
||||
final class ResponseIsSuccessful extends Constraint
|
||||
{
|
||||
/**
|
||||
* {@inheritdoc}
|
||||
*/
|
||||
public function toString(): string
|
||||
{
|
||||
return 'is successful';
|
||||
@@ -26,8 +23,6 @@ final class ResponseIsSuccessful extends Constraint
|
||||
|
||||
/**
|
||||
* @param Response $response
|
||||
*
|
||||
* {@inheritdoc}
|
||||
*/
|
||||
protected function matches($response): bool
|
||||
{
|
||||
@@ -36,8 +31,6 @@ final class ResponseIsSuccessful extends Constraint
|
||||
|
||||
/**
|
||||
* @param Response $response
|
||||
*
|
||||
* {@inheritdoc}
|
||||
*/
|
||||
protected function failureDescription($response): string
|
||||
{
|
||||
@@ -46,8 +39,6 @@ final class ResponseIsSuccessful extends Constraint
|
||||
|
||||
/**
|
||||
* @param Response $response
|
||||
*
|
||||
* {@inheritdoc}
|
||||
*/
|
||||
protected function additionalFailureDescription($response): string
|
||||
{
|
||||
|
@@ -16,9 +16,6 @@ use Symfony\Component\HttpFoundation\Response;
|
||||
|
||||
final class ResponseIsUnprocessable extends Constraint
|
||||
{
|
||||
/**
|
||||
* {@inheritdoc}
|
||||
*/
|
||||
public function toString(): string
|
||||
{
|
||||
return 'is unprocessable';
|
||||
@@ -26,8 +23,6 @@ final class ResponseIsUnprocessable extends Constraint
|
||||
|
||||
/**
|
||||
* @param Response $other
|
||||
*
|
||||
* {@inheritdoc}
|
||||
*/
|
||||
protected function matches($other): bool
|
||||
{
|
||||
@@ -36,8 +31,6 @@ final class ResponseIsUnprocessable extends Constraint
|
||||
|
||||
/**
|
||||
* @param Response $other
|
||||
*
|
||||
* {@inheritdoc}
|
||||
*/
|
||||
protected function failureDescription($other): string
|
||||
{
|
||||
@@ -46,8 +39,6 @@ final class ResponseIsUnprocessable extends Constraint
|
||||
|
||||
/**
|
||||
* @param Response $other
|
||||
*
|
||||
* {@inheritdoc}
|
||||
*/
|
||||
protected function additionalFailureDescription($other): string
|
||||
{
|
||||
|
@@ -16,16 +16,13 @@ use Symfony\Component\HttpFoundation\Response;
|
||||
|
||||
final class ResponseStatusCodeSame extends Constraint
|
||||
{
|
||||
private $statusCode;
|
||||
private int $statusCode;
|
||||
|
||||
public function __construct(int $statusCode)
|
||||
{
|
||||
$this->statusCode = $statusCode;
|
||||
}
|
||||
|
||||
/**
|
||||
* {@inheritdoc}
|
||||
*/
|
||||
public function toString(): string
|
||||
{
|
||||
return 'status code is '.$this->statusCode;
|
||||
@@ -33,8 +30,6 @@ final class ResponseStatusCodeSame extends Constraint
|
||||
|
||||
/**
|
||||
* @param Response $response
|
||||
*
|
||||
* {@inheritdoc}
|
||||
*/
|
||||
protected function matches($response): bool
|
||||
{
|
||||
@@ -43,8 +38,6 @@ final class ResponseStatusCodeSame extends Constraint
|
||||
|
||||
/**
|
||||
* @param Response $response
|
||||
*
|
||||
* {@inheritdoc}
|
||||
*/
|
||||
protected function failureDescription($response): string
|
||||
{
|
||||
@@ -53,8 +46,6 @@ final class ResponseStatusCodeSame extends Constraint
|
||||
|
||||
/**
|
||||
* @param Response $response
|
||||
*
|
||||
* {@inheritdoc}
|
||||
*/
|
||||
protected function additionalFailureDescription($response): string
|
||||
{
|
||||
|
Reference in New Issue
Block a user