Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Require a recent phpunit version in integration and acceptance
Otherwise build with PHP>8 will fail as PHPUnit 6 does not support it

Signed-off-by: Côme Chilliet <[email protected]>
  • Loading branch information
come-nc authored and danxuliu committed May 24, 2022
commit 8951f069fef6916bd293d278c2491b82bc349fc1
3 changes: 2 additions & 1 deletion build/integration/composer.json
Original file line number Diff line number Diff line change
@@ -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",
Expand Down
4 changes: 2 additions & 2 deletions build/integration/features/bootstrap/AppConfiguration.php
Original file line number Diff line number Diff line change
Expand Up @@ -96,9 +96,9 @@ protected function setStatusTestingApp($enabled) {
$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());
}
}

Expand Down
4 changes: 2 additions & 2 deletions build/integration/features/bootstrap/CommandLine.php
Original file line number Diff line number Diff line change
Expand Up @@ -141,13 +141,13 @@ public function theCommandFailedWithException($exceptionText) {
* @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');
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -147,6 +147,6 @@ public function usingTransferFolderAsDavPath($user) {
* @Then /^transfer folder name contains "([^"]+)"$/
*/
public function transferFolderNameContains($text) {
Assert::assertContains($text, $this->lastTransferPath);
Assert::assertStringContainsString($text, $this->lastTransferPath);
}
}
16 changes: 8 additions & 8 deletions build/integration/features/bootstrap/Provisioning.php
Original file line number Diff line number Diff line change
Expand Up @@ -175,7 +175,7 @@ public function userHasSetting($user, $settings) {
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]);
}
Expand Down Expand Up @@ -206,7 +206,7 @@ public function groupHasSetting($group, $settings) {
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]);
}
Expand Down Expand Up @@ -399,7 +399,7 @@ public function userDoesNotBelongToGroup($user, $group) {
$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());
}

Expand Down Expand Up @@ -658,7 +658,7 @@ public function theUsersShouldBe($usersList) {
$users = $usersList->getRows();
$usersSimplified = $this->simplifyArray($users);
$respondedArray = $this->getArrayOfUsersResponded($this->response);
Assert::assertEquals($usersSimplified, $respondedArray, "", 0.0, 10, true);
Assert::assertEqualsCanonicalizing($usersSimplified, $respondedArray);
}
}

Expand Down Expand Up @@ -698,7 +698,7 @@ public function theGroupsShouldBe($groupsList) {
$groups = $groupsList->getRows();
$groupsSimplified = $this->simplifyArray($groups);
$respondedArray = $this->getArrayOfGroupsResponded($this->response);
Assert::assertEquals($groupsSimplified, $respondedArray, "", 0.0, 10, true);
Assert::assertEqualsCanonicalizing($groupsSimplified, $respondedArray);
}
}

Expand All @@ -711,7 +711,7 @@ public function theSubadminGroupsShouldBe($groupsList) {
$groups = $groupsList->getRows();
$groupsSimplified = $this->simplifyArray($groups);
$respondedArray = $this->getArrayOfSubadminsResponded($this->response);
Assert::assertEquals($groupsSimplified, $respondedArray, "", 0.0, 10, true);
Assert::assertEqualsCanonicalizing($groupsSimplified, $respondedArray);
}
}

Expand All @@ -724,7 +724,7 @@ public function theAppsShouldBe($appList) {
$apps = $appList->getRows();
$appsSimplified = $this->simplifyArray($apps);
$respondedArray = $this->getArrayOfAppsResponded($this->response);
Assert::assertEquals($appsSimplified, $respondedArray, "", 0.0, 10, true);
Assert::assertEqualsCanonicalizing($appsSimplified, $respondedArray);
}
}

Expand Down Expand Up @@ -1000,7 +1000,7 @@ public function userHasNotSetting($user, \Behat\Gherkin\Node\TableNode $settings
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]);
Expand Down
3 changes: 2 additions & 1 deletion build/integration/features/bootstrap/Trashbin.php
Original file line number Diff line number Diff line change
Expand Up @@ -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';
Expand Down Expand Up @@ -138,7 +139,7 @@ public function checkTrashContains($user, $type, $file) {
return $item['{http://nextcloud.org/ns}trashbin-filename'];
}, $elementList));

Assert::assertArraySubset([$name], array_values($trashContent));
AssertArraySubset::assertArraySubset([$name], array_values($trashContent));
}

/**
Expand Down
2 changes: 1 addition & 1 deletion tests/acceptance/composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
"behat/mink": "1.8.1",
"behat/mink-extension": "2.3.1",
"behat/mink-selenium2-driver": "1.4.0",
"phpunit/phpunit": "6.5.14"
"phpunit/phpunit": "9.5.19"
},
"autoload": {
"psr-4": {
Expand Down
Loading