aboutsummaryrefslogtreecommitdiffstats
path: root/tests/acceptance/features/bootstrap/PublicShareContext.php
diff options
context:
space:
mode:
authorDaniel Calviño Sánchez <danxuliu@gmail.com>2021-01-17 18:20:52 +0100
committerJohn Molakvoæ (skjnldsv) <skjnldsv@protonmail.com>2021-03-30 08:35:15 +0200
commitb53f49b94062bbbf8de8a10c74af4ed8521919cd (patch)
treef08183d525657a4e53ea1abdf96bf06d647896d7 /tests/acceptance/features/bootstrap/PublicShareContext.php
parent59d567e8643c9c3a1e8422b7fd203253565df239 (diff)
downloadnextcloud-server-b53f49b94062bbbf8de8a10c74af4ed8521919cd.tar.gz
nextcloud-server-b53f49b94062bbbf8de8a10c74af4ed8521919cd.zip
Update PHPUnit from 4.X to 6.X in acceptance tests
The PHPUnit update also required an update of "symfony/yaml", so besides the changes needed for PHPUnit the "behat.yml" file also had to be adjusted. Signed-off-by: Daniel Calviño Sánchez <danxuliu@gmail.com>
Diffstat (limited to 'tests/acceptance/features/bootstrap/PublicShareContext.php')
-rw-r--r--tests/acceptance/features/bootstrap/PublicShareContext.php27
1 files changed, 14 insertions, 13 deletions
diff --git a/tests/acceptance/features/bootstrap/PublicShareContext.php b/tests/acceptance/features/bootstrap/PublicShareContext.php
index 2213cf877f9..2895202ed7f 100644
--- a/tests/acceptance/features/bootstrap/PublicShareContext.php
+++ b/tests/acceptance/features/bootstrap/PublicShareContext.php
@@ -22,6 +22,7 @@
*/
use Behat\Behat\Context\Context;
+use PHPUnit\Framework\Assert;
class PublicShareContext implements Context, ActorAwareInterface {
use ActorAware;
@@ -143,7 +144,7 @@ class PublicShareContext implements Context, ActorAwareInterface {
* @Then I see that the current page is the Authenticate page for the shared link I wrote down
*/
public function iSeeThatTheCurrentPageIsTheAuthenticatePageForTheSharedLinkIWroteDown() {
- PHPUnit_Framework_Assert::assertEquals(
+ Assert::assertEquals(
$this->actor->getSharedNotebook()["shared link"] . "/authenticate/showShare",
$this->actor->getSession()->getCurrentUrl());
}
@@ -152,7 +153,7 @@ class PublicShareContext implements Context, ActorAwareInterface {
* @Then I see that the current page is the Authenticate page for the direct download shared link I wrote down
*/
public function iSeeThatTheCurrentPageIsTheAuthenticatePageForTheDirectDownloadSharedLinkIWroteDown() {
- PHPUnit_Framework_Assert::assertEquals(
+ Assert::assertEquals(
$this->actor->getSharedNotebook()["shared link"] . "/authenticate/downloadShare",
$this->actor->getSession()->getCurrentUrl());
}
@@ -161,7 +162,7 @@ class PublicShareContext implements Context, ActorAwareInterface {
* @Then I see that the current page is the shared link I wrote down
*/
public function iSeeThatTheCurrentPageIsTheSharedLinkIWroteDown() {
- PHPUnit_Framework_Assert::assertEquals(
+ Assert::assertEquals(
$this->actor->getSharedNotebook()["shared link"],
$this->actor->getSession()->getCurrentUrl());
@@ -172,7 +173,7 @@ class PublicShareContext implements Context, ActorAwareInterface {
* @Then I see that the current page is the direct download shared link I wrote down
*/
public function iSeeThatTheCurrentPageIsTheDirectDownloadSharedLinkIWroteDown() {
- PHPUnit_Framework_Assert::assertEquals(
+ Assert::assertEquals(
$this->actor->getSharedNotebook()["shared link"] . "/download",
$this->actor->getSession()->getCurrentUrl());
}
@@ -181,7 +182,7 @@ class PublicShareContext implements Context, ActorAwareInterface {
* @Then I see that a wrong password for the shared file message is shown
*/
public function iSeeThatAWrongPasswordForTheSharedFileMessageIsShown() {
- PHPUnit_Framework_Assert::assertTrue(
+ Assert::assertTrue(
$this->actor->find(self::wrongPasswordMessage(), 10)->isVisible());
}
@@ -194,19 +195,19 @@ class PublicShareContext implements Context, ActorAwareInterface {
// command not having been processed by the browser.
if (!WaitFor::elementToBeEventuallyShown(
$this->actor, self::shareMenu(), $timeout = 10 * $this->actor->getFindTimeoutMultiplier())) {
- PHPUnit_Framework_Assert::fail("The Share menu is not visible yet after $timeout seconds");
+ Assert::fail("The Share menu is not visible yet after $timeout seconds");
}
// The acceptance tests are run in a window wider than the mobile breakpoint, so the
// download item should not be shown in the menu (although it will be in
// the DOM).
- PHPUnit_Framework_Assert::assertFalse(
+ Assert::assertFalse(
$this->actor->find(self::downloadItemInShareMenu())->isVisible(),
"Download item in share menu is visible");
- PHPUnit_Framework_Assert::assertTrue(
+ Assert::assertTrue(
$this->actor->find(self::directLinkItemInShareMenu())->isVisible(),
"Direct link item in share menu is not visible");
- PHPUnit_Framework_Assert::assertTrue(
+ Assert::assertTrue(
$this->actor->find(self::saveItemInShareMenu())->isVisible(),
"Save item in share menu is not visible");
}
@@ -216,7 +217,7 @@ class PublicShareContext implements Context, ActorAwareInterface {
*/
public function iSeeThatTheShareMenuButtonIsNotShown() {
try {
- PHPUnit_Framework_Assert::assertFalse(
+ Assert::assertFalse(
$this->actor->find(self::shareMenuButton())->isVisible());
} catch (NoSuchElementException $exception) {
}
@@ -226,7 +227,7 @@ class PublicShareContext implements Context, ActorAwareInterface {
* @Then I see that the shared file preview shows the text :text
*/
public function iSeeThatTheSharedFilePreviewShowsTheText($text) {
- PHPUnit_Framework_Assert::assertContains($text, $this->actor->find(self::textPreview(), 10)->getText());
+ Assert::assertContains($text, $this->actor->find(self::textPreview(), 10)->getText());
}
/**
@@ -235,7 +236,7 @@ class PublicShareContext implements Context, ActorAwareInterface {
public function iSeeThatTheDownloadButtonIsShown() {
if (!WaitFor::elementToBeEventuallyShown(
$this->actor, self::downloadButton(), $timeout = 10 * $this->actor->getFindTimeoutMultiplier())) {
- PHPUnit_Framework_Assert::fail("The download button is not visible yet after $timeout seconds");
+ Assert::fail("The download button is not visible yet after $timeout seconds");
}
}
@@ -244,7 +245,7 @@ class PublicShareContext implements Context, ActorAwareInterface {
*/
public function iSeeThatTheDownloadButtonIsNotShown() {
try {
- PHPUnit_Framework_Assert::assertFalse(
+ Assert::assertFalse(
$this->actor->find(self::downloadButton())->isVisible());
} catch (NoSuchElementException $exception) {
}