public function testCanCloseAnOpenAction()
{
// ----------------------------------------------------------------
// setup your test
// the message we want to log
$msg = "This is a test message";
// our mock output facade
$output = Mockery::mock("DataSift\\Storyplayer\\Output");
$output->shouldReceive('logPhaseActivity')->once()->with($msg, null);
// our mock DI container
$i = new Injectables();
$i->dataFormatter = new DataFormatter();
$i->dataFormatter->setIsVerbose(true);
$i->output = $output;
// and, our test subject
$obj = new Action_Logger($i);
$log = $obj->startAction($msg);
// ----------------------------------------------------------------
// perform the change
$obj->closeAllOpenActions();
// ----------------------------------------------------------------
// test the results
$this->assertTrue($log->getIsComplete());
$action = $obj->getOpenAction();
$this->assertNull($action);
// all done
Mockery::close();
}