/** * 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 testUnity() { $unity = 'pièce'; $this->assertSame($this->entity, $this->entity->setUnity($unity)); $this->assertSame($unity, $this->entity->getUnity()); }