public function testBuildForm() { $currencyManager = $this->getMock('Sonata\\Component\\Currency\\CurrencyManagerInterface'); $type = new ApiBasketType('my.test.class', $currencyManager); $builder = $this->getMockBuilder('Symfony\\Component\\Form\\FormBuilder')->disableOriginalConstructor()->getMock(); $builder->expects($this->once())->method('create')->will($this->returnSelf()); $builder->expects($this->once())->method('addModelTransformer'); $type->buildForm($builder, array()); }