public function testCreate() { $event = new CategoryCreateEvent(); $event->setLocale('en_US')->setParent(0)->setTitle('foo')->setVisible(1)->setDispatcher($this->getDispatcher()); $action = new Category(); $action->create($event); $createdCategory = $event->getCategory(); $this->assertInstanceOf('Thelia\\Model\\Category', $createdCategory); $this->assertFalse($createdCategory->isNew()); $this->assertEquals('en_US', $createdCategory->getLocale()); $this->assertEquals('foo', $createdCategory->getTitle()); $this->assertEquals(1, $createdCategory->getVisible()); $this->assertEquals(0, $createdCategory->getParent()); $this->assertNull($createdCategory->getDescription()); $this->assertNull($createdCategory->getChapo()); $this->assertNull($createdCategory->getPostscriptum()); return $createdCategory; }