logCliErrorWithException() public method

called when the outer CLI shell encounters a fatal error
public logCliErrorWithException ( string $msg, Exception $e ) : void
$msg string the error message to show the user
$e Exception the exception that caused the error
return void
Exemplo n.º 1
0
 /**
  * @covers DataSift\Storyplayer\Output::logCliErrorWithException()
  */
 public function testCanLogCliErrorWithException()
 {
     // ----------------------------------------------------------------
     // setup the test
     $msg = "this is an emergency, damnit!";
     $e = new Exception();
     $plugin1 = Mockery::mock("DataSift\\Storyplayer\\OutputLib\\OutputPlugin");
     $plugin1->shouldReceive('logCliErrorWithException')->once()->with($msg, $e);
     $plugin2 = Mockery::mock("DataSift\\Storyplayer\\OutputLib\\OutputPlugin");
     $plugin2->shouldReceive('logCliErrorWithException')->once()->with($msg, $e);
     $obj = new Output();
     $obj->usePluginInSlot($plugin1, "console");
     $obj->usePluginInSlot($plugin2, "slot1");
     // ----------------------------------------------------------------
     // perform the change
     $obj->logCliErrorWithException($msg, $e);
     // ----------------------------------------------------------------
     // test the results
     Mockery::close();
 }