DataSift\Storyplayer\Output::getActiveConsolePlugin PHP Метод

getActiveConsolePlugin() публичный Метод

return the active plugin in the 'console' slot
public getActiveConsolePlugin ( ) : Console | null
Результат DataSift\Storyplayer\Console\Console | null
    public function getActiveConsolePlugin()
    {
        // we ALWAYS have a console plugin :)
        return $this->plugins['console'];
    }

Usage Example

Пример #1
0
 /**
  * @covers DataSift\Storyplayer\Output::getPlugins()
  */
 public function testCanGetAllActivePlugins()
 {
     // ----------------------------------------------------------------
     // setup the test
     $obj = new Output();
     $slotName = 'unit-test';
     $origPlugin = Mockery::mock('DataSift\\Storyplayer\\OutputLib\\OutputPlugin');
     $obj->usePluginInSlot($origPlugin, $slotName);
     $console = $obj->getActiveConsolePlugin();
     // ----------------------------------------------------------------
     // perform the change
     $plugins = $obj->getPlugins();
     // ----------------------------------------------------------------
     // test the results
     $this->assertTrue(is_array($plugins));
     $this->assertEquals(2, count($plugins));
     $this->assertSame($console, $plugins['console']);
     $this->assertSame($origPlugin, $plugins[$slotName]);
     Mockery::close();
 }