Skip to content

Commit

Permalink
ignore some more tests
Browse files Browse the repository at this point in the history
  • Loading branch information
dmaicher committed Aug 28, 2020
1 parent b2e92c5 commit cb81952
Show file tree
Hide file tree
Showing 2 changed files with 19 additions and 2 deletions.
15 changes: 14 additions & 1 deletion tests/Admin/AdminTest.php
Expand Up @@ -83,6 +83,7 @@
use Symfony\Component\PropertyAccess\PropertyAccess;
use Symfony\Component\Routing\RouterInterface;
use Symfony\Component\Security\Core\Exception\AccessDeniedException;
use Symfony\Component\Translation\TranslatorInterface as LegacyTranslatorInterface;
use Symfony\Component\Validator\Mapping\MemberMetadata;
use Symfony\Component\Validator\Mapping\PropertyMetadataInterface;
use Symfony\Component\Validator\Validator\ValidatorInterface;
Expand Down Expand Up @@ -1445,10 +1446,16 @@ public function testTransWithMessageDomain(): void
*/
public function testTransChoice(): void
{
if (!interface_exists(LegacyTranslatorInterface::class)) {
$this->markTestSkipped('This test is only available using Symfony 4');

return;
}

$admin = new PostAdmin('sonata.post.admin.post', 'NewsBundle\Entity\Post', 'Sonata\NewsBundle\Controller\PostAdminController');
$admin->setTranslationDomain('fooMessageDomain');

$translator = $this->createMock(TranslatorInterface::class);
$translator = $this->createMock(LegacyTranslatorInterface::class);
$admin->setTranslator($translator);

$translator->expects($this->once())
Expand All @@ -1464,6 +1471,12 @@ public function testTransChoice(): void
*/
public function testTransChoiceWithMessageDomain(): void
{
if (!interface_exists(LegacyTranslatorInterface::class)) {
$this->markTestSkipped('This test is only available using Symfony 4');

return;
}

$admin = new PostAdmin('sonata.post.admin.post', 'NewsBundle\Entity\Post', 'Sonata\NewsBundle\Controller\PostAdminController');

$translator = $this->createMock(TranslatorInterface::class);
Expand Down
6 changes: 5 additions & 1 deletion tests/Twig/Extension/SonataAdminExtensionTest.php
Expand Up @@ -290,7 +290,11 @@ public function testConstructThrowsExceptionWithWrongTranslationArgument(): void
*/
public function testConstructWithLegacyTranslator(): void
{
$this->markTestSkipped('This test is only available using Symfony 4');
if (!interface_exists(LegacyTranslatorInterface::class)) {
$this->markTestSkipped('This test is only available using Symfony 4');

return;
}

new SonataAdminExtension(
$this->pool,
Expand Down

0 comments on commit cb81952

Please sign in to comment.