示例#1
0
 protected function getUpdateEvent($data)
 {
     $changeEvent = new ConfigUpdateEvent($data['id']);
     // Create and dispatch the change event
     $changeEvent->setEventName($data['name'])->setValue($data['value'])->setHidden($data['hidden'])->setSecured($data['secured'])->setLocale($data["locale"])->setTitle($data['title'])->setChapo($data['chapo'])->setDescription($data['description'])->setPostscriptum($data['postscriptum']);
     return $changeEvent;
 }
示例#2
0
 /**
  * @param ConfigModel $config
  * @depends testSetValue
  */
 public function testModify(ConfigModel $config)
 {
     $event = new ConfigUpdateEvent($config->getId());
     $event->setEventName('foo')->setValue('update baz')->setLocale('en_US')->setTitle('config title')->setDescription('config description')->setChapo('config chapo')->setPostscriptum('config postscriptum')->setHidden(0)->setSecured(0)->setDispatcher($this->dispatcher);
     $action = new Config();
     $action->modify($event);
     $updatedConfig = $event->getConfig();
     $this->assertInstanceOf('Thelia\\Model\\Config', $updatedConfig);
     $this->assertEquals('foo', $updatedConfig->getName());
     $this->assertEquals('update baz', $updatedConfig->getValue());
     $this->assertEquals('en_US', $updatedConfig->getLocale());
     $this->assertEquals('config title', $updatedConfig->getTitle());
     $this->assertEquals('config description', $updatedConfig->getDescription());
     $this->assertEquals('config chapo', $updatedConfig->getChapo());
     $this->assertEquals('config postscriptum', $updatedConfig->getPostscriptum());
     $this->assertEquals(0, $updatedConfig->getHidden());
     $this->assertEquals(0, $updatedConfig->getSecured());
     return $updatedConfig;
 }