From 6ad0c3b85a416d7ab74377e2649d9d77464f1c7b Mon Sep 17 00:00:00 2001 From: Gintautas Miselis Date: Sun, 24 Nov 2019 18:06:46 +0200 Subject: [PATCH] Compatibility with Symfony 5 --- composer.json | 4 ++-- src/Codeception/Lib/InnerBrowser.php | 7 +++++-- 2 files changed, 7 insertions(+), 4 deletions(-) diff --git a/composer.json b/composer.json index 5e51595..ee0b92b 100644 --- a/composer.json +++ b/composer.json @@ -20,8 +20,8 @@ "require": { "php": ">=5.6.0 <8.0", "codeception/codeception": "*@dev", - "symfony/browser-kit": ">=2.7 <5.0", - "symfony/dom-crawler": ">=2.7 <5.0" + "symfony/browser-kit": ">=2.7 <6.0", + "symfony/dom-crawler": ">=2.7 <6.0" }, "require-dev": { "codeception/util-universalframework": "dev-master" diff --git a/src/Codeception/Lib/InnerBrowser.php b/src/Codeception/Lib/InnerBrowser.php index 296c5b9..776c3a4 100644 --- a/src/Codeception/Lib/InnerBrowser.php +++ b/src/Codeception/Lib/InnerBrowser.php @@ -539,7 +539,7 @@ public function seeLink($text, $url = null) $this->assertTrue(true); } - public function dontSeeLink($text, $url = null) + public function dontSeeLink($text, $url = '') { $crawler = $this->getCrawler()->selectLink($text); if (!$url) { @@ -547,7 +547,10 @@ public function dontSeeLink($text, $url = null) $this->fail("Link containing text '$text' was found in page " . $this->_getCurrentUri()); } } - $crawler = $crawler->filterXPath(sprintf('.//a[substring(@href, string-length(@href) - string-length(%1$s) + 1)=%1$s]', Crawler::xpathLiteral($url))); + $crawler = $crawler->filterXPath( + sprintf('.//a[substring(@href, string-length(@href) - string-length(%1$s) + 1)=%1$s]', + Crawler::xpathLiteral($url)) + ); if ($crawler->count() > 0) { $this->fail("Link containing text '$text' and URL '$url' was found in page " . $this->_getCurrentUri()); }