diff options
author | Carl Schwan <carl@carlschwan.eu> | 2022-05-24 23:18:20 +0300 |
---|---|---|
committer | GitHub <noreply@github.com> | 2022-05-24 23:18:20 +0300 |
commit | eb5e0a4e511551ae493d7bc3ca77045ba2b9480c (patch) | |
tree | 7703a02c98ccf47d7d92f276c6e75d370f9a905b /build | |
parent | 1fc2e903a7a2ba8a463a2ae88946f17059e405cb (diff) | |
parent | 8951f069fef6916bd293d278c2491b82bc349fc1 (diff) |
Merge pull request #31761 from nextcloud/fix/upgarde-phpunit-in-ci-to-recent-version
Require a recent phpunit version in integration and acceptance
Diffstat (limited to 'build')
6 files changed, 17 insertions, 15 deletions
diff --git a/build/integration/composer.json b/build/integration/composer.json index 0ab212b3cdf..a9ba7980064 100644 --- a/build/integration/composer.json +++ b/build/integration/composer.json @@ -1,6 +1,7 @@ { "require-dev": { - "phpunit/phpunit": "~6.5", + "phpunit/phpunit": "^9", + "dms/phpunit-arraysubset-asserts": "^0.4", "behat/behat": "~3.10.0", "guzzlehttp/guzzle": "7.4.2", "jarnaiz/behat-junit-formatter": "^1.3", diff --git a/build/integration/features/bootstrap/AppConfiguration.php b/build/integration/features/bootstrap/AppConfiguration.php index 8cb9d1e1f02..740a8b169a6 100644 --- a/build/integration/features/bootstrap/AppConfiguration.php +++ b/build/integration/features/bootstrap/AppConfiguration.php @@ -96,9 +96,9 @@ trait AppConfiguration { $this->sendingTo('get', '/cloud/apps?filter=enabled'); $this->theHTTPStatusCodeShouldBe('200'); if ($enabled) { - Assert::assertContains('testing', $this->response->getBody()->getContents()); + Assert::assertStringContainsString('testing', $this->response->getBody()->getContents()); } else { - Assert::assertNotContains('testing', $this->response->getBody()->getContents()); + Assert::assertStringNotContainsString('testing', $this->response->getBody()->getContents()); } } diff --git a/build/integration/features/bootstrap/CommandLine.php b/build/integration/features/bootstrap/CommandLine.php index 0320f68f340..cba254551e0 100644 --- a/build/integration/features/bootstrap/CommandLine.php +++ b/build/integration/features/bootstrap/CommandLine.php @@ -141,13 +141,13 @@ trait CommandLine { * @Then /^the command output contains the text "([^"]*)"$/ */ public function theCommandOutputContainsTheText($text) { - Assert::assertContains($text, $this->lastStdOut, 'The command did not output the expected text on stdout'); + Assert::assertStringContainsString($text, $this->lastStdOut, 'The command did not output the expected text on stdout'); } /** * @Then /^the command error output contains the text "([^"]*)"$/ */ public function theCommandErrorOutputContainsTheText($text) { - Assert::assertContains($text, $this->lastStdErr, 'The command did not output the expected text on stderr'); + Assert::assertStringContainsString($text, $this->lastStdErr, 'The command did not output the expected text on stderr'); } } diff --git a/build/integration/features/bootstrap/CommandLineContext.php b/build/integration/features/bootstrap/CommandLineContext.php index 41756e448bf..afe17cd75a4 100644 --- a/build/integration/features/bootstrap/CommandLineContext.php +++ b/build/integration/features/bootstrap/CommandLineContext.php @@ -147,6 +147,6 @@ class CommandLineContext implements \Behat\Behat\Context\Context { * @Then /^transfer folder name contains "([^"]+)"$/ */ public function transferFolderNameContains($text) { - Assert::assertContains($text, $this->lastTransferPath); + Assert::assertStringContainsString($text, $this->lastTransferPath); } } diff --git a/build/integration/features/bootstrap/Provisioning.php b/build/integration/features/bootstrap/Provisioning.php index 1b01a636918..7fb4188f919 100644 --- a/build/integration/features/bootstrap/Provisioning.php +++ b/build/integration/features/bootstrap/Provisioning.php @@ -175,7 +175,7 @@ trait Provisioning { Assert::assertTrue(in_array($expected, $value['element'], true)); } } elseif (isset($value[0])) { - Assert::assertEquals($setting[1], $value[0], "", 0.0, 10, true); + Assert::assertEqualsCanonicalizing($setting[1], $value[0]); } else { Assert::assertEquals('', $setting[1]); } @@ -206,7 +206,7 @@ trait Provisioning { foreach ($settings->getRows() as $setting) { $value = json_decode(json_encode($groupDetails->{$setting[0]}), 1); if (isset($value[0])) { - Assert::assertEquals($setting[1], $value[0], "", 0.0, 10, true); + Assert::assertEqualsCanonicalizing($setting[1], $value[0]); } else { Assert::assertEquals('', $setting[1]); } @@ -399,7 +399,7 @@ trait Provisioning { $this->response = $client->get($fullUrl, $options); $groups = [$group]; $respondedArray = $this->getArrayOfGroupsResponded($this->response); - Assert::assertNotEquals($groups, $respondedArray, "", 0.0, 10, true); + Assert::assertNotEqualsCanonicalizing($groups, $respondedArray); Assert::assertEquals(200, $this->response->getStatusCode()); } @@ -658,7 +658,7 @@ trait Provisioning { $users = $usersList->getRows(); $usersSimplified = $this->simplifyArray($users); $respondedArray = $this->getArrayOfUsersResponded($this->response); - Assert::assertEquals($usersSimplified, $respondedArray, "", 0.0, 10, true); + Assert::assertEqualsCanonicalizing($usersSimplified, $respondedArray); } } @@ -698,7 +698,7 @@ trait Provisioning { $groups = $groupsList->getRows(); $groupsSimplified = $this->simplifyArray($groups); $respondedArray = $this->getArrayOfGroupsResponded($this->response); - Assert::assertEquals($groupsSimplified, $respondedArray, "", 0.0, 10, true); + Assert::assertEqualsCanonicalizing($groupsSimplified, $respondedArray); } } @@ -711,7 +711,7 @@ trait Provisioning { $groups = $groupsList->getRows(); $groupsSimplified = $this->simplifyArray($groups); $respondedArray = $this->getArrayOfSubadminsResponded($this->response); - Assert::assertEquals($groupsSimplified, $respondedArray, "", 0.0, 10, true); + Assert::assertEqualsCanonicalizing($groupsSimplified, $respondedArray); } } @@ -724,7 +724,7 @@ trait Provisioning { $apps = $appList->getRows(); $appsSimplified = $this->simplifyArray($apps); $respondedArray = $this->getArrayOfAppsResponded($this->response); - Assert::assertEquals($appsSimplified, $respondedArray, "", 0.0, 10, true); + Assert::assertEqualsCanonicalizing($appsSimplified, $respondedArray); } } @@ -1000,7 +1000,7 @@ trait Provisioning { Assert::assertFalse(in_array($expected, $value, true)); } } else { - Assert::assertNotEquals($setting[1], $value[0], "", 0.0, 10, true); + Assert::assertNotEqualsCanonicalizing($setting[1], $value[0]); } } else { Assert::assertNotEquals('', $setting[1]); diff --git a/build/integration/features/bootstrap/Trashbin.php b/build/integration/features/bootstrap/Trashbin.php index f286147e3eb..998720b67b2 100644 --- a/build/integration/features/bootstrap/Trashbin.php +++ b/build/integration/features/bootstrap/Trashbin.php @@ -22,6 +22,7 @@ * along with this program. If not, see <http://www.gnu.org/licenses/> * */ +use DMS\PHPUnitExtensions\ArraySubset\Assert as AssertArraySubset; use PHPUnit\Framework\Assert; require __DIR__ . '/../../vendor/autoload.php'; @@ -138,7 +139,7 @@ trait Trashbin { return $item['{http://nextcloud.org/ns}trashbin-filename']; }, $elementList)); - Assert::assertArraySubset([$name], array_values($trashContent)); + AssertArraySubset::assertArraySubset([$name], array_values($trashContent)); } /** |