Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Allow php8 build to pass #6333

Merged
merged 1 commit into from
Aug 29, 2020
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
13 changes: 11 additions & 2 deletions tests/Admin/AdminTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
10 changes: 0 additions & 10 deletions tests/Command/SetupAclCommandTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -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());
}
}