public function testTransChoice() { $admin = new PostAdmin('sonata.post.admin.post', 'NewsBundle\\Entity\\Post', 'SonataNewsBundle:PostAdmin'); $admin->setTranslationDomain('fooMessageDomain'); $translator = $this->getMock('Symfony\\Component\\Translation\\TranslatorInterface'); $admin->setTranslator($translator); $translator->expects($this->once())->method('transChoice')->with($this->equalTo('foo'), $this->equalTo(2), $this->equalTo(array()), $this->equalTo('fooMessageDomain'))->will($this->returnValue('fooTranslated')); $this->assertSame('fooTranslated', $admin->transChoice('foo', 2)); }