DataSift\Storyplayer\Output::usePluginAsConsole PHP Method

usePluginAsConsole() public method

make a plugin the one that we use when writing to the user's console
public usePluginAsConsole ( Console $plugin ) : void
$plugin DataSift\Storyplayer\Console\Console the plugin that we want
return void
    public function usePluginAsConsole(Console $plugin)
    {
        $this->plugins['console'] = $plugin;
    }

Usage Example

Exemplo n.º 1
0
 /**
  * @covers DataSift\Storyplayer\Output::usePluginAsConsole()
  */
 public function testCanSwitchToAnyConsole()
 {
     // ----------------------------------------------------------------
     // setup the test
     $obj = new Output();
     $console = Mockery::mock('DataSift\\Storyplayer\\Console\\Console');
     // ----------------------------------------------------------------
     // perform the change
     $obj->usePluginAsConsole($console);
     // ----------------------------------------------------------------
     // test the results
     $activeConsole = $obj->getActiveConsolePlugin();
     $this->assertSame($console, $activeConsole);
     Mockery::close();
 }