From b8b26c01a67eeb21f045328b0e87c8c48a2aa82c Mon Sep 17 00:00:00 2001 From: Gabriel Caruso Date: Fri, 2 Feb 2018 19:39:04 -0200 Subject: [PATCH] [5.6] PHPUnit 7 (#23005) --- composer.json | 2 +- .../Foundation/Testing/Constraints/HasInDatabase.php | 6 +++--- .../Testing/Constraints/SoftDeletedInDatabase.php | 6 +++--- 3 files changed, 7 insertions(+), 7 deletions(-) diff --git a/composer.json b/composer.json index cd2cd03f28f1..23a026ab4333 100644 --- a/composer.json +++ b/composer.json @@ -78,7 +78,7 @@ "moontoast/math": "^1.1", "orchestra/testbench-core": "3.6.*", "pda/pheanstalk": "~3.0", - "phpunit/phpunit": "~6.0", + "phpunit/phpunit": "~7.0", "predis/predis": "^1.1.1", "symfony/css-selector": "~4.0", "symfony/dom-crawler": "~4.0" diff --git a/src/Illuminate/Foundation/Testing/Constraints/HasInDatabase.php b/src/Illuminate/Foundation/Testing/Constraints/HasInDatabase.php index 413ccad83128..b88f34222872 100644 --- a/src/Illuminate/Foundation/Testing/Constraints/HasInDatabase.php +++ b/src/Illuminate/Foundation/Testing/Constraints/HasInDatabase.php @@ -48,7 +48,7 @@ public function __construct(Connection $database, array $data) * @param string $table * @return bool */ - public function matches($table) + public function matches($table): bool { return $this->database->table($table)->where($this->data)->count() > 0; } @@ -59,7 +59,7 @@ public function matches($table) * @param string $table * @return string */ - public function failureDescription($table) + public function failureDescription($table): string { return sprintf( "a row in the table [%s] matches the attributes %s.\n\n%s", @@ -96,7 +96,7 @@ protected function getAdditionalInfo($table) * @param int $options * @return string */ - public function toString($options = 0) + public function toString($options = 0): string { return json_encode($this->data, $options); } diff --git a/src/Illuminate/Foundation/Testing/Constraints/SoftDeletedInDatabase.php b/src/Illuminate/Foundation/Testing/Constraints/SoftDeletedInDatabase.php index 7d44997a8987..abab48cc5511 100644 --- a/src/Illuminate/Foundation/Testing/Constraints/SoftDeletedInDatabase.php +++ b/src/Illuminate/Foundation/Testing/Constraints/SoftDeletedInDatabase.php @@ -48,7 +48,7 @@ public function __construct(Connection $database, array $data) * @param string $table * @return bool */ - public function matches($table) + public function matches($table): bool { return $this->database->table($table) ->where($this->data)->whereNotNull('deleted_at')->count() > 0; @@ -60,7 +60,7 @@ public function matches($table) * @param string $table * @return string */ - public function failureDescription($table) + public function failureDescription($table): string { return sprintf( "any soft deleted row in the table [%s] matches the attributes %s.\n\n%s", @@ -96,7 +96,7 @@ protected function getAdditionalInfo($table) * * @return string */ - public function toString() + public function toString(): string { return json_encode($this->data); }