/** * @param AttributeAvModel $attributeAv * @depends testCreate */ public function testUpdate(AttributeAvModel $attributeAv) { $event = new AttributeAvUpdateEvent($attributeAv->getId()); $event->setLocale($attributeAv->getLocale())->setTitle('bar')->setDescription('bar description')->setChapo('bar chapo')->setPostscriptum('bar postscriptum')->setDispatcher($this->getMock("Symfony\\Component\\EventDispatcher\\EventDispatcherInterface")); $action = new AttributeAv(); $action->update($event); $updatedAttributeAv = $event->getAttributeAv(); $this->assertInstanceOf('Thelia\\Model\\AttributeAv', $updatedAttributeAv); $this->assertEquals('bar', $updatedAttributeAv->getTitle()); $this->assertEquals('bar description', $updatedAttributeAv->getDescription()); $this->assertEquals('bar chapo', $updatedAttributeAv->getChapo()); $this->assertEquals('bar postscriptum', $updatedAttributeAv->getPostscriptum()); return $updatedAttributeAv; }