Skip to content

Commit

Permalink
change AdminInterface
Browse files Browse the repository at this point in the history
  • Loading branch information
dmaicher committed Aug 30, 2020
1 parent b9c0db5 commit ad2ed34
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 7 deletions.
8 changes: 4 additions & 4 deletions src/Admin/AdminInterface.php
Original file line number Diff line number Diff line change
Expand Up @@ -33,8 +33,9 @@
use Symfony\Component\Form\FormBuilderInterface;
use Symfony\Component\Form\FormInterface;
use Symfony\Component\HttpFoundation\Request;
use Symfony\Component\Translation\TranslatorInterface;
use Symfony\Component\Translation\TranslatorInterface as LegacyTranslatorInterface;
use Symfony\Component\Validator\Validator\ValidatorInterface;
use Symfony\Contracts\Translation\TranslatorInterface;

/**
* @author Thomas Rabaix <[email protected]>
Expand Down Expand Up @@ -64,6 +65,7 @@
* @method void reorderFormGroup(string $group, array $keys)
* @method void defineFormBuilder(FormBuilderInterface $formBuilder)
* @method string getPagerType()
* @method void setTranslator($translator);
*/
interface AdminInterface extends AccessRegistryInterface, FieldDescriptionRegistryInterface, LifecycleHookProviderInterface, MenuBuilderInterface, ParentAdminInterface, UrlGeneratorInterface
{
Expand All @@ -90,10 +92,8 @@ public function setDatagridBuilder(DatagridBuilderInterface $datagridBuilder);
*/
public function getDatagridBuilder();

public function setTranslator(TranslatorInterface $translator);

/**
* @return TranslatorInterface
* @return TranslatorInterface|LegacyTranslatorInterface
*/
public function getTranslator();

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@
use JMS\TranslationBundle\Translation\ExtractorInterface;
use PHPUnit\Framework\TestCase;
use Psr\Log\LoggerInterface;
use Sonata\AdminBundle\Admin\AbstractAdmin;
use Sonata\AdminBundle\Admin\AdminInterface;
use Sonata\AdminBundle\Admin\BreadcrumbsBuilderInterface;
use Sonata\AdminBundle\Admin\Pool;
Expand Down Expand Up @@ -71,10 +72,10 @@ protected function setUp(): void
$this->markTestSkipped('JMS Translator Bundle does not exist');
}

$this->fooAdmin = $this->getMockForAbstractClass(AdminInterface::class);
$this->barAdmin = $this->getMockForAbstractClass(AdminInterface::class);
$this->fooAdmin = $this->createMock(AbstractAdmin::class);
$this->barAdmin = $this->createMock(AbstractAdmin::class);

$container = $this->getMockForAbstractClass(ContainerInterface::class);
$container = $this->createMock(ContainerInterface::class);
$container
->method('get')
->willReturnCallback(function (string $id): AdminInterface {
Expand Down

0 comments on commit ad2ed34

Please sign in to comment.