public function testCreate() { $attribute = AttributeQuery::create()->findOne(); $event = new AttributeAvCreateEvent(); $event->setAttributeId($attribute->getId())->setLocale('en_US')->setTitle('foo')->setDispatcher($this->getMock("Symfony\\Component\\EventDispatcher\\EventDispatcherInterface")); $action = new AttributeAv(); $action->create($event); $attributeAvCreated = $event->getAttributeAv(); $this->assertInstanceOf('Thelia\\Model\\AttributeAv', $attributeAvCreated); $this->assertEquals('en_US', $attributeAvCreated->getLocale()); $this->assertEquals('foo', $attributeAvCreated->getTitle()); $this->assertNull($attributeAvCreated->getDescription()); $this->assertNull($attributeAvCreated->getPostscriptum()); $this->assertNull($attributeAvCreated->getChapo()); $this->assertEquals($attribute, $attributeAvCreated->getAttribute()); return $attributeAvCreated; }