public function testGetForm() { $form = $this->getMock('Symfony\\Component\\Form\\Test\\FormInterface'); $form->expects($this->once())->method('getName')->willReturn('form_name'); $this->container->expects($this->once())->method('get')->with(self::FORM_SERVICE_ID)->will($this->returnValue($form)); $formAccessor = new DependencyInjectionFormAccessor($this->container, self::FORM_SERVICE_ID); $this->assertSame($form, $formAccessor->getForm()); $this->assertEquals('form_name', $formAccessor->getName()); }