public function testRead() { list($filesystem) = $this->getMocks(); $instance = new FilesystemHandler($filesystem); $mockFile = m::mock('Xpressengine\\Storage\\File'); $mockFile->shouldReceive('getAttribute')->once()->with('disk')->andReturn('local'); $mockFile->shouldReceive('getPathname')->andReturn('attached/filenamestring'); $mockFilesystem = m::mock('Illuminate\\Contracts\\Filesystem\\Filesystem'); $mockFilesystem->shouldReceive('get')->once()->with('attached/filenamestring')->andReturn('content'); $filesystem->shouldReceive('disk')->once()->with('local')->andReturn($mockFilesystem); $this->assertEquals('content', $instance->read($mockFile)); }