From fcac62c15ca626a9dacf6edee0b5c284ee0cee09 Mon Sep 17 00:00:00 2001 From: Gintautas Miselis Date: Sat, 15 Feb 2020 21:00:25 +0200 Subject: [PATCH 1/2] Fix broken test assertContains uses strict comparison in PHPUnit 9 --- tests/unit/Codeception/Module/TestsForWeb.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/tests/unit/Codeception/Module/TestsForWeb.php b/tests/unit/Codeception/Module/TestsForWeb.php index e399e41..44e76db 100644 --- a/tests/unit/Codeception/Module/TestsForWeb.php +++ b/tests/unit/Codeception/Module/TestsForWeb.php @@ -11,7 +11,7 @@ abstract class TestsForWeb extends \Codeception\Test\Unit { /** - * @var \Codeception\Module\PhpBrowser + * @var \Codeception\Module\UniversalFramework */ protected $module; @@ -1416,7 +1416,7 @@ public function testCheckingOptionsWithComplexNames() $this->module->checkOption('#bmessage-topicslinks input[value="4"]'); $this->module->click('Submit'); $data = data::get('form'); - $this->assertContains(4, $data['BMessage']['topicsLinks']); + $this->assertContains('4', $data['BMessage']['topicsLinks']); } /** From ce78d1dad82b0c8509361d6159b8ce4418acd269 Mon Sep 17 00:00:00 2001 From: Gintautas Miselis Date: Sat, 15 Feb 2020 21:02:17 +0200 Subject: [PATCH 2/2] proceedSeeInField casts value to string before comparison because assertContains compares strictly in PHPUnit 9 --- src/Codeception/Lib/InnerBrowser.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/Codeception/Lib/InnerBrowser.php b/src/Codeception/Lib/InnerBrowser.php index 1dbf401..fbc9f7e 100644 --- a/src/Codeception/Lib/InnerBrowser.php +++ b/src/Codeception/Lib/InnerBrowser.php @@ -753,7 +753,7 @@ protected function proceedSeeInField(Crawler $fields, $value) } return [ 'Contains', - $value, + (string)$value, $testValues, sprintf( 'Failed asserting that `%s` is in %s\'s value: %s',