/** * Displays a form to create a new Product entity. * * @Template() * @Secure(roles="ROLE_USER") */ public function newAction() { $entity = new Product(); $entity->setUnity('pièce'); $entity->setDiscountSupplier(0); $entity->setExpenseRatio(10); $entity->setShipping(0); $entity->setUnitPrice(0); $form = $this->createNewForm($entity); return array('entity' => $entity, 'form' => $form->createView()); }
public function testSupplier() { $supplier = $this->getMock('JLM\\ProductBundle\\model\\SupplierInterface'); $this->assertSame($this->entity, $this->entity->setSupplier($supplier)); $this->assertSame($supplier, $this->entity->getSupplier()); }