create(); Storage::disk('textures') ->putFileAs('.', UploadedFile::fake()->image($texture->hash), $texture->hash); $mock = Mockery::mock('overload:Minecraft'); $mock->shouldReceive('generateAvatarFromSkin')->andReturn(imagecreatetruecolor(1, 1)); event(new GetAvatarPreview($texture, 45)); $this->assertTrue(Cache::has("avatar-{$texture->tid}-45")); } }