Otherwise build with PHP>8 will fail as PHPUnit 6 does not support it Signed-off-by: Côme Chilliet <come.chilliet@nextcloud.com>tags/v25.0.0beta1
@@ -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", |
@@ -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()); | |||
} | |||
} | |||
@@ -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'); | |||
} | |||
} |
@@ -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); | |||
} | |||
} |
@@ -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]); |
@@ -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)); | |||
} | |||
/** |
@@ -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": { |
@@ -227,7 +227,7 @@ class PublicShareContext implements Context, ActorAwareInterface { | |||
* @Then I see that the shared file preview shows the text :text | |||
*/ | |||
public function iSeeThatTheSharedFilePreviewShowsTheText($text) { | |||
Assert::assertContains($text, $this->actor->find(self::textPreview(), 10)->getText()); | |||
Assert::assertStringContainsString($text, $this->actor->find(self::textPreview(), 10)->getText()); | |||
} | |||
/** |