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); } }
/** * @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(); }