DataSift\Storyplayer\Output::startPhaseGroup PHP Method

startPhaseGroup() public method

called when we start playing a new PhaseGroup
public startPhaseGroup ( string $activity, string $name ) : void
$activity string what are we doing? (e.g. 'creating', 'running')
$name string the name of the phase group
return void
    public function startPhaseGroup($activity, $name)
    {
        // ensure our inputs!
        Contract::RequiresValue($activity, is_string($activity));
        Contract::RequiresValue($name, is_string($name));
        // call our plugins
        foreach ($this->plugins as $plugin) {
            $plugin->startPhaseGroup($activity, $name);
        }
    }

Usage Example

Exemplo n.º 1
0
 /**
  * @covers DataSift\Storyplayer\Output::startPhaseGroup()
  */
 public function testCanStartPhaseGroup()
 {
     // ----------------------------------------------------------------
     // setup the test
     $activity = "starting";
     $name = "unit test";
     $plugin1 = Mockery::mock("DataSift\\Storyplayer\\OutputLib\\OutputPlugin");
     $plugin1->shouldReceive('startPhaseGroup')->once()->with($activity, $name);
     $plugin2 = Mockery::mock("DataSift\\Storyplayer\\OutputLib\\OutputPlugin");
     $plugin2->shouldReceive('startPhaseGroup')->once()->with($activity, $name);
     $obj = new Output();
     $obj->usePluginInSlot($plugin1, "console");
     $obj->usePluginInSlot($plugin2, "slot1");
     // ----------------------------------------------------------------
     // perform the change
     $obj->startPhaseGroup($activity, $name);
     // ----------------------------------------------------------------
     // test the results
     Mockery::close();
 }