public function endStoryplayer($duration) { $retval = 0; foreach ($this->plugins as $plugin) { $retval = max($retval, $plugin->endStoryplayer($duration)); } return $retval; }
/** * @covers DataSift\Storyplayer\Output::endStoryplayer() */ public function testCanEndStoryplayer() { // ---------------------------------------------------------------- // setup the test $duration = 100; $plugin1 = Mockery::mock("DataSift\\Storyplayer\\OutputLib\\OutputPlugin"); $plugin1->shouldReceive('endStoryplayer')->once()->with($duration); $plugin2 = Mockery::mock("DataSift\\Storyplayer\\OutputLib\\OutputPlugin"); $plugin2->shouldReceive('endStoryplayer')->once()->with($duration); $obj = new Output(); $obj->usePluginInSlot($plugin1, "console"); $obj->usePluginInSlot($plugin2, "slot1"); // ---------------------------------------------------------------- // perform the change $obj->endStoryplayer($duration); // ---------------------------------------------------------------- // test the results Mockery::close(); }