/** * @covers DataSift\Storyplayer\Output::logPhaseActivity() */ public function testCanLogPhaseActivityWithCodeLine() { // ---------------------------------------------------------------- // setup the test $msg = "a unit-test is running ... do not be alarmed!"; $codeLine = ["file" => "unit-test.php", "line" => 666, "code" => "\$st->fromUnitTests()->testAllTheThings();"]; $plugin1 = Mockery::mock("DataSift\\Storyplayer\\OutputLib\\OutputPlugin"); $plugin1->shouldReceive('logPhaseActivity')->once()->with($msg, $codeLine); $plugin2 = Mockery::mock("DataSift\\Storyplayer\\OutputLib\\OutputPlugin"); $plugin2->shouldReceive('logPhaseActivity')->once()->with($msg, $codeLine); $obj = new Output(); $obj->usePluginInSlot($plugin1, "console"); $obj->usePluginInSlot($plugin2, "slot1"); // ---------------------------------------------------------------- // perform the change $obj->logPhaseActivity($msg, $codeLine); // ---------------------------------------------------------------- // test the results Mockery::close(); }