DataSift\Storyplayer\Output::getActiveConsolePlugin PHP Method

getActiveConsolePlugin() public method

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

Usage Example

Exemplo n.º 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();
 }