php spec tets translatora w symfony

public function it_should_return_true(Order $order, TranslatorInterface $translator): void
    {
        $flagsToBlock = ['xxxx', 'aaaa', 'bbbb'];

        $order->hasFlagByCode('xxxx')->willReturn(false);
        $order->hasFlagByCode('aaaa')->willReturn(false);
        $order->hasFlagByCode('bbbb')->willReturn(false);

        $translator->trans(
            'enp.order.order_quick_return.order_source.error',
            [
                '%flagsToBlock%' => implode(',', $flagsToBlock),
            ],
            'EnpOrderBundle'
        )->willReturn('message');

        $this->beConstructedWith($flagsToBlock, $translator);
        $this->check($order)->shouldReturn(true);
        $this->getErrorMessage()->shouldBe('message');
    }
Komentarze wyłączone