예제 #1
0
 /**
  * @covers TBGEvent::getReturnList
  * @covers TBGEvent::addToReturnList
  * @covers TBGEvent::setReturnValue
  * @covers TBGEvent::getReturnValue
  * @depends testCreateNew
  */
 public function testReturnListAndReturnValue(TBGEvent $event)
 {
     $this->assertArrayHasKey(0, $event->getReturnList());
     $this->assertContains('listitem1', $event->getReturnList());
     $this->assertArrayHasKey(1, $event->getReturnList());
     $this->assertContains('listitem2', $event->getReturnList());
     $event->addToReturnList('listitem3');
     $this->assertContains('listitem3', $event->getReturnList());
     $event->setReturnValue('fubar');
     $this->assertEquals('fubar', $event->getReturnValue());
     $event->setReturnValue(null);
     $this->assertEquals(null, $event->getReturnValue());
 }
예제 #2
0
 public function listen_BreadcrumbProjectLinks(TBGEvent $event)
 {
     $link = array('url' => TBGContext::getRouting()->generate('publish_article', array('article_name' => TBGContext::getCurrentProject()->getKey() . ':MainPage')), 'title' => $this->getMenuTitle(true));
     $event->addToReturnList($link);
 }
 public function listen_getcommit(TBGEvent $event)
 {
     $event->setReturnValue('vcs_integration/commitbackdrop');
     $event->addToReturnList(TBGContext::getRequest()->getParameter('commit_id'), 'commit_id');
     $event->setProcessed();
 }
예제 #4
0
 public function listen_get_backdrop_partial(TBGEvent $event)
 {
     if ($event->getSubject() == 'mailing_editincomingemailaccount') {
         $account = new TBGIncomingEmailAccount(TBGContext::getRequest()->getParameter('account_id'));
         $event->addToReturnList($account, 'account');
         $event->setReturnValue('mailing/editincomingemailaccount');
         $event->setProcessed();
     }
 }