Beispiel #1
0
 public function testCreateSimple()
 {
     $event = new AttributeCreateEvent();
     $event->setLocale('en_US')->setTitle('foo')->setDispatcher($this->getMock("Symfony\\Component\\EventDispatcher\\EventDispatcherInterface"));
     $action = new Attribute();
     $action->create($event);
     $createdAttribute = $event->getAttribute();
     $this->assertInstanceOf('Thelia\\Model\\Attribute', $createdAttribute);
     $this->assertEquals($createdAttribute->getLocale(), 'en_US');
     $this->assertEquals($createdAttribute->getTitle(), 'foo');
     return $createdAttribute;
 }
 public function testCreateSimple()
 {
     $event = new AttributeCreateEvent();
     $event->setLocale('en_US')->setTitle('foo');
     $action = new Attribute($this->getMockEventDispatcher());
     $action->create($event, null, $this->getMockEventDispatcher());
     $createdAttribute = $event->getAttribute();
     $this->assertInstanceOf('Thelia\\Model\\Attribute', $createdAttribute);
     $this->assertEquals($createdAttribute->getLocale(), 'en_US');
     $this->assertEquals($createdAttribute->getTitle(), 'foo');
     return $createdAttribute;
 }