Exemplo n.º 1
0
 public function testCreate()
 {
     $event = new ConfigCreateEvent();
     $event->setEventName('foo')->setValue('bar')->setLocale('en_US')->setTitle('test config foo bar')->setHidden(true)->setSecured(true)->setDispatcher($this->dispatcher);
     $action = new Config();
     $action->create($event);
     $createdConfig = $event->getConfig();
     $this->assertInstanceOf('Thelia\\Model\\Config', $createdConfig);
     $this->assertFalse($createdConfig->isNew());
     $this->assertEquals('foo', $createdConfig->getName());
     $this->assertEquals('bar', $createdConfig->getValue());
     $this->assertEquals('en_US', $createdConfig->getLocale());
     $this->assertEquals('test config foo bar', $createdConfig->getTitle());
     $this->assertEquals(1, $createdConfig->getHidden());
     $this->assertEquals(1, $createdConfig->getSecured());
     return $createdConfig;
 }
Exemplo n.º 2
0
 protected function getCreationEvent($data)
 {
     $createEvent = new ConfigCreateEvent();
     $createEvent->setEventName($data['name'])->setValue($data['value'])->setLocale($data["locale"])->setTitle($data['title'])->setHidden($data['hidden'])->setSecured($data['secured']);
     return $createEvent;
 }