/** * @param AttributeModel $attribute * @depends testUpdate */ public function testDelete(AttributeModel $attribute) { $event = new AttributeDeleteEvent($attribute->getId()); $action = new Attribute(); $action->delete($event, null, $this->getMockEventDispatcher()); $deletedAttribute = $event->getAttribute(); $this->assertInstanceOf('Thelia\\Model\\Attribute', $deletedAttribute); $this->assertTrue($deletedAttribute->isDeleted()); }
/** * @depends testUpdate */ public function testDelete(AttributeModel $attribute) { $event = new AttributeDeleteEvent($attribute->getId()); $event->setDispatcher($this->getMock("Symfony\\Component\\EventDispatcher\\EventDispatcherInterface")); $action = new Attribute(); $action->delete($event); $deletedAttribute = $event->getAttribute(); $this->assertInstanceOf('Thelia\\Model\\Attribute', $deletedAttribute); $this->assertTrue($deletedAttribute->isDeleted()); }