diff --git a/.github/workflows/test.yaml b/.github/workflows/test.yaml index a08c2652eac..842b01fee4c 100644 --- a/.github/workflows/test.yaml +++ b/.github/workflows/test.yaml @@ -25,35 +25,27 @@ jobs: - '7.2' - '7.3' - '7.4' - phpunit-version: ['8.5'] dependencies: [highest] allowed_to_fail: [false] variant: [normal] include: - php-version: '7.2' - phpunit-version: '8.5' dependencies: lowest allowed_to_fail: false variant: normal - php-version: '8.0' - phpunit-version: '9.3' dependencies: highest allowed_to_fail: true variant: normal - php-version: '7.3' - phpunit-version: '8.5' dependencies: highest allowed_to_fail: false variant: 'symfony/symfony:"4.4.*"' - php-version: '7.3' - phpunit-version: '8.5' dependencies: highest allowed_to_fail: false variant: 'sonata-project/block-bundle:"3.*"' - env: - SYMFONY_PHPUNIT_VERSION: ${{ matrix.phpunit-version }} - steps: - name: Checkout uses: actions/checkout@v2 diff --git a/tests/Admin/AdminTest.php b/tests/Admin/AdminTest.php index f56e2ae2dfe..b4a19b6721d 100644 --- a/tests/Admin/AdminTest.php +++ b/tests/Admin/AdminTest.php @@ -694,11 +694,20 @@ public function testToString(): void $s = new FooToString(); $this->assertSame('salut', $admin->toString($s)); + $this->assertSame('', $admin->toString(false)); + } + + public function testToStringNull(): void + { + if (\PHP_VERSION_ID >= 80000) { + $this->markTestSkipped('PHP 8.0 does not allow __toString() method to return null'); + } + + $admin = new PostAdmin('sonata.post.admin.post', 'NewsBundle\Entity\Post', 'Sonata\NewsBundle\Controller\PostAdminController'); + // To string method is implemented, but returns null $s = new FooToStringNull(); $this->assertNotEmpty($admin->toString($s)); - - $this->assertSame('', $admin->toString(false)); } public function testIsAclEnabled(): void diff --git a/tests/Command/SetupAclCommandTest.php b/tests/Command/SetupAclCommandTest.php index 0d836543d99..8d5a520d757 100644 --- a/tests/Command/SetupAclCommandTest.php +++ b/tests/Command/SetupAclCommandTest.php @@ -77,14 +77,4 @@ public function testExecuteWithException1(): void $commandTester->getDisplay() ); } - - public function testExecuteWithException2(): void - { - $pool = new Pool($this->container, '', ''); - - $this->expectException(\TypeError::class); - $this->expectExceptionMessage(sprintf('Argument 2 passed to %s::__construct() must implement interface %s, instance of %s given', SetupAclCommand::class, AdminAclManipulatorInterface::class, \stdClass::class)); - - new SetupAclCommand($pool, new \stdClass()); - } }