public function testModifyContent() { list($handler, $repo, $auth, $keygen) = $this->getMocks(); $instance = new Storage($handler, $repo, $auth, $keygen); $content = 'new file content'; $mockFile = m::mock('Xpressengine\\Storage\\File'); $handler->shouldReceive('change')->once()->with($mockFile, $content)->andReturn($mockFile); $repo->shouldReceive('update')->once()->with($mockFile)->andReturn($mockFile); $file = $instance->modifyContent($mockFile, $content); $this->assertInstanceOf('Xpressengine\\Storage\\File', $file); }