Пример #1
0
 protected function getCreationEvent($formData)
 {
     $event = new ProfileEvent();
     $event->setLocale($formData['locale']);
     $event->setCode($formData['code']);
     $event->setTitle($formData['title']);
     $event->setChapo($formData['chapo']);
     $event->setDescription($formData['description']);
     $event->setPostscriptum($formData['postscriptum']);
     return $event;
 }
Пример #2
0
 public function testCreate()
 {
     $event = new ProfileEvent();
     $event->setCode("Test")->setLocale('en_US')->setTitle('test profile')->setChapo('test chapo')->setDescription('test description')->setPostscriptum('test postscriptum');
     $action = new Profile($this->getMockEventDispatcher());
     $action->create($event, null, $this->getMockEventDispatcher());
     $createdProfile = $event->getProfile();
     $this->assertInstanceOf('Thelia\\Model\\Profile', $createdProfile);
     $this->assertFalse($createdProfile->isNew());
     $this->assertEquals('Test', $createdProfile->getCode());
     $this->assertEquals('en_US', $createdProfile->getLocale());
     $this->assertEquals('test profile', $createdProfile->getTitle());
     $this->assertEquals('test chapo', $createdProfile->getChapo());
     $this->assertEquals('test description', $createdProfile->getDescription());
     $this->assertEquals('test postscriptum', $createdProfile->getPostscriptum());
     return $createdProfile;
 }