diff --git a/tests/web/TestsForWeb.php b/tests/web/TestsForWeb.php index 02db5b9..08c86d9 100644 --- a/tests/web/TestsForWeb.php +++ b/tests/web/TestsForWeb.php @@ -150,7 +150,7 @@ public function testSeeLinkFailsIfHrefDoesNotMatch() public function testSeeLinkFailsIfHrefDoesNotMatchExactly() { $this->expectException('PHPUnit\Framework\AssertionFailedError'); - $this->expectExceptionMessage("No links containing text 'Next' and URL 'http://codeception' were found in page /external_url"); + $this->expectExceptionMessage("No links containing text 'Next' and URL 'https://codeception' were found in page /external_url"); $this->module->amOnPage('/external_url'); $this->module->seeLink('Next', 'https://codeception'); } diff --git a/tests/web/WebDriverTest.php b/tests/web/WebDriverTest.php index 1aa406c..fb03626 100644 --- a/tests/web/WebDriverTest.php +++ b/tests/web/WebDriverTest.php @@ -7,6 +7,7 @@ use Codeception\Module\WebDriver; use Codeception\Stub; use Codeception\Stub\Expected; +use Codeception\Test\Metadata; use Codeception\Util\Maybe; use data; use Facebook\WebDriver\Cookie; @@ -581,13 +582,27 @@ public function testCreateCestScreenshotOnFail() ]), ]); $module = Stub::make(self::MODULE_CLASS, ['webDriver' => $fakeWd]); - $cest = new \Codeception\Test\Cest(new \stdClass(), 'login', 'someCest.php'); + $cest = new \Codeception\Test\Cest( + new class { + public function login() + { + } + }, + 'login', + 'someCest.php', + ); $module->_failed($cest, new \PHPUnit\Framework\AssertionFailedError()); } public function testCreateTestScreenshotOnFail() { - $test = Stub::make(\Codeception\Test\Unit::class, ['getName' => 'testLogin']); + $test = Stub::make( + \Codeception\Test\TestCaseWrapper::class, + [ + 'getSignature' => 'testLogin', + 'getMetadata' => new Metadata(), + ] + ); $fakeWd = Stub::make(self::WEBDRIVER_CLASS, [ 'takeScreenshot' => Expected::once(function ($filename) use ($test) { Assert::assertSame(