DataSift\Storyplayer\Output::logCliInfo PHP Method

logCliInfo() public method

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

Usage Example

Exemplo n.º 1
0
 /**
  * @covers DataSift\Storyplayer\Output::logCliInfo()
  */
 public function testCanLogCliInfo()
 {
     // ----------------------------------------------------------------
     // setup the test
     $msg = "there's nothing to see here ... move along, move along";
     $plugin1 = Mockery::mock("DataSift\\Storyplayer\\OutputLib\\OutputPlugin");
     $plugin1->shouldReceive('logCliInfo')->once()->with($msg);
     $plugin2 = Mockery::mock("DataSift\\Storyplayer\\OutputLib\\OutputPlugin");
     $plugin2->shouldReceive('logCliInfo')->once()->with($msg);
     $obj = new Output();
     $obj->usePluginInSlot($plugin1, "console");
     $obj->usePluginInSlot($plugin2, "slot1");
     // ----------------------------------------------------------------
     // perform the change
     $obj->logCliInfo($msg);
     // ----------------------------------------------------------------
     // test the results
     Mockery::close();
 }