DataSift\Storyplayer\Output::startStoryplayer PHP Method

startStoryplayer() public method

called when storyplayer starts
public startStoryplayer ( string $version, string $url, string $copyright, string $license ) : void
$version string
$url string
$copyright string
$license string
return void
    public function startStoryplayer($version, $url, $copyright, $license)
    {
        // enforce our inputs
        Contract::RequiresValue($version, is_string($version));
        Contract::RequiresValue($url, is_string($url));
        Contract::RequiresValue($copyright, is_string($copyright));
        Contract::RequiresValue($license, is_string($license));
        // call all of our plugins
        foreach ($this->plugins as $plugin) {
            $plugin->startStoryplayer($version, $url, $copyright, $license);
        }
    }

Usage Example

Exemplo n.º 1
0
 /**
  * @covers DataSift\Storyplayer\Output::startStoryplayer()
  */
 public function testCanStartStoryplayer()
 {
     // ----------------------------------------------------------------
     // setup the test
     $version = "6.6.6";
     $url = "http://notarealurl.topleveldomain";
     $copyright = "a copyright string";
     $license = "a license string";
     $plugin1 = Mockery::mock("DataSift\\Storyplayer\\OutputLib\\OutputPlugin");
     $plugin1->shouldReceive('startStoryplayer')->once()->with($version, $url, $copyright, $license);
     $plugin2 = Mockery::mock("DataSift\\Storyplayer\\OutputLib\\OutputPlugin");
     $plugin2->shouldReceive('startStoryplayer')->once()->with($version, $url, $copyright, $license);
     $obj = new Output();
     $obj->usePluginInSlot($plugin1, "console");
     $obj->usePluginInSlot($plugin2, "slot1");
     // ----------------------------------------------------------------
     // perform the change
     $obj->startStoryplayer($version, $url, $copyright, $license);
     // ----------------------------------------------------------------
     // test the results
     Mockery::close();
 }