create(); Storage::disk('textures') ->putFileAs('.', UploadedFile::fake()->image($skin->hash), $skin->hash); $mock = Mockery::mock('overload:Minecraft'); $mock->shouldReceive('generatePreviewFromSkin')->andReturn(imagecreatetruecolor(1, 1)); event(new GetSkinPreview($skin, 45)); $this->assertTrue(Cache::has("preview-{$skin->tid}-45")); $cape = factory(Texture::class, 'cape')->create(); Storage::disk('textures') ->putFileAs('.', UploadedFile::fake()->image($cape->hash), $cape->hash); $mock->shouldReceive('generatePreviewFromCape')->andReturn(imagecreatetruecolor(1, 1)); event(new GetSkinPreview($cape, 45)); $this->assertTrue(Cache::has("preview-{$cape->tid}-45")); } }