Skip to content

Commit 3173fdd

Browse files
committed
Fix tests incompatible with Codeception 5
1 parent 3a0cb1c commit 3173fdd

File tree

1 file changed

+6
-2
lines changed

1 file changed

+6
-2
lines changed

tests/web/WebDriverTest.php

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -581,13 +581,17 @@ public function testCreateCestScreenshotOnFail()
581581
]),
582582
]);
583583
$module = Stub::make(self::MODULE_CLASS, ['webDriver' => $fakeWd]);
584-
$cest = new \Codeception\Test\Cest(new \stdClass(), 'login', 'someCest.php');
584+
$cest = new \Codeception\Test\Cest(
585+
new class { public function login() {}},
586+
'login',
587+
'someCest.php',
588+
);
585589
$module->_failed($cest, new \PHPUnit\Framework\AssertionFailedError());
586590
}
587591

588592
public function testCreateTestScreenshotOnFail()
589593
{
590-
$test = Stub::make(\Codeception\Test\Unit::class, ['getName' => 'testLogin']);
594+
$test = Stub::make(\Codeception\Test\TestCaseWrapper::class, ['getName' => 'getSignature']);
591595
$fakeWd = Stub::make(self::WEBDRIVER_CLASS, [
592596
'takeScreenshot' => Expected::once(function ($filename) use ($test) {
593597
Assert::assertSame(

0 commit comments

Comments
 (0)