diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index 0c991a8c..f9ef116b 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -9,7 +9,7 @@ jobs: strategy: matrix: php: [8.0, 8.1] - symfony: ["4.4.*", "5.4.*"] + symfony: ["4.4.*", "5.4.*", "6.0.*"] steps: - name: Checkout code @@ -29,7 +29,7 @@ jobs: with: repository: Codeception/symfony-module-tests path: framework-tests - ref: 4.4_codecept5 + ref: "4.4_codecept5" - name: Checkout Symfony 5.4 Sample if: "matrix.symfony == '5.4.*'" @@ -37,7 +37,15 @@ jobs: with: repository: Codeception/symfony-module-tests path: framework-tests - ref: 5.4_codecept5 + ref: "5.4_codecept5" + + - name: Checkout Symfony 6.0 Sample + if: "matrix.symfony == '6.0.*'" + uses: actions/checkout@v2 + with: + repository: Codeception/symfony-module-tests + path: framework-tests + ref: "6.0" - name: Get composer cache directory id: composer-cache diff --git a/src/Codeception/Module/Symfony/FormAssertionsTrait.php b/src/Codeception/Module/Symfony/FormAssertionsTrait.php index ec84212b..3b923059 100644 --- a/src/Codeception/Module/Symfony/FormAssertionsTrait.php +++ b/src/Codeception/Module/Symfony/FormAssertionsTrait.php @@ -50,7 +50,7 @@ public function seeFormErrorMessage(string $field, ?string $message = null): voi { $formCollector = $this->grabFormCollector(__FUNCTION__); - if (!$forms = $formCollector->getData()->getValue('forms')['forms']) { + if (!$forms = $formCollector->getData()->getValue(true)['forms']) { $this->fail('There are no forms on the current page.'); } diff --git a/src/Codeception/Module/Symfony/SessionAssertionsTrait.php b/src/Codeception/Module/Symfony/SessionAssertionsTrait.php index 73a440dc..e7ff9cbb 100644 --- a/src/Codeception/Module/Symfony/SessionAssertionsTrait.php +++ b/src/Codeception/Module/Symfony/SessionAssertionsTrait.php @@ -82,11 +82,12 @@ public function dontSeeInSession(string $attribute, $value = null): void { $session = $this->getCurrentSession(); - if (null === $value) { - if ($session->has($attribute)) { - $this->fail("Session attribute with name '{$attribute}' does exist"); - } - } else { + if ($attributeExists = $session->has($attribute)) { + $this->fail("Session attribute with name '{$attribute}' does exist"); + } + $this->assertFalse($attributeExists); + + if (null !== $value) { $this->assertNotSame($value, $session->get($attribute)); } } @@ -167,9 +168,10 @@ public function seeInSession(string $attribute, $value = null): void { $session = $this->getCurrentSession(); - if (!$session->has($attribute)) { + if (!$attributeExists = $session->has($attribute)) { $this->fail("No session attribute with name '{$attribute}'"); } + $this->assertTrue($attributeExists); if (null !== $value) { $this->assertSame($value, $session->get($attribute));
Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.
Alternative Proxies: