DataSift\Storyplayer\Output::logCliError PHP Method

logCliError() public method

called when the outer CLI shell encounters a fatal error
public logCliError ( string $msg ) : void
$msg string the error message to show the user
return void
    public function logCliError($msg)
    {
        // enforce our inputs
        Contract::RequiresValue($msg, is_string($msg));
        // pass it on to our plugins
        foreach ($this->plugins as $plugin) {
            $plugin->logCliError($msg);
        }
    }

Usage Example

Exemplo n.º 1
0
 /**
  * @covers DataSift\Storyplayer\Output::logCliError()
  */
 public function testCanLogCliError()
 {
     // ----------------------------------------------------------------
     // setup the test
     $msg = "this is an emergency, damnit!";
     $plugin1 = Mockery::mock("DataSift\\Storyplayer\\OutputLib\\OutputPlugin");
     $plugin1->shouldReceive('logCliError')->once()->with($msg);
     $plugin2 = Mockery::mock("DataSift\\Storyplayer\\OutputLib\\OutputPlugin");
     $plugin2->shouldReceive('logCliError')->once()->with($msg);
     $obj = new Output();
     $obj->usePluginInSlot($plugin1, "console");
     $obj->usePluginInSlot($plugin2, "slot1");
     // ----------------------------------------------------------------
     // perform the change
     $obj->logCliError($msg);
     // ----------------------------------------------------------------
     // test the results
     Mockery::close();
 }
All Usage Examples Of DataSift\Storyplayer\Output::logCliError