예제 #1
0
 /**
  * @test
  */
 public function eventShouldInitializeCorrectly()
 {
     $plugin = $this->getMockForAbstractClass('Xi\\Filelib\\Plugin\\Plugin');
     $filelib = $this->getMockedFilelib();
     $event = new PluginEvent($plugin, $filelib);
     $plugin2 = $event->getPlugin();
     $this->assertSame($plugin, $plugin2);
     $this->assertSame($filelib, $event->getFilelib());
 }
예제 #2
0
 /**
  * Fires on plugin.add event. Adds plugin if plugin has profile.
  *
  * @param PluginEvent $event
  */
 public function onPluginAdd(PluginEvent $event)
 {
     $plugin = $event->getPlugin();
     if ($plugin->belongsToProfile($this->getIdentifier())) {
         $this->addPlugin($plugin);
     }
 }