DataSift\Storyplayer\Output::logPhaseCodeLine PHP Method

logPhaseCodeLine() public method

called when we want to record which line of code in a phase is currently executing
public logPhaseCodeLine ( array $codeLine ) : void
$codeLine array details about the line of code that is executing
return void
    public function logPhaseCodeLine($codeLine)
    {
        // enforce our inputs
        Contract::RequiresValue($codeLine, is_array($codeLine));
        // pass it on to all of our plugins
        foreach ($this->plugins as $plugin) {
            $plugin->logPhaseCodeLine($codeLine);
        }
    }

Usage Example

Exemplo n.º 1
0
 /**
  * @covers DataSift\Storyplayer\Output::logPhaseCodeLine()
  */
 public function testCanLogPhaseCodeLine()
 {
     // ----------------------------------------------------------------
     // setup the test
     $codeLine = ["file" => "unit-test.php", "line" => 666, "code" => "\$st->fromUnitTests()->testAllTheThings();"];
     $plugin1 = Mockery::mock("DataSift\\Storyplayer\\OutputLib\\OutputPlugin");
     $plugin1->shouldReceive('logPhaseCodeLine')->once()->with($codeLine);
     $plugin2 = Mockery::mock("DataSift\\Storyplayer\\OutputLib\\OutputPlugin");
     $plugin2->shouldReceive('logPhaseCodeLine')->once()->with($codeLine);
     $obj = new Output();
     $obj->usePluginInSlot($plugin1, "console");
     $obj->usePluginInSlot($plugin2, "slot1");
     // ----------------------------------------------------------------
     // perform the change
     $obj->logPhaseCodeLine($codeLine);
     // ----------------------------------------------------------------
     // test the results
     Mockery::close();
 }