Tweak tests

This commit is contained in:
Pig Fang 2019-04-05 09:19:08 +08:00
parent c5d2082308
commit b9c2cdff6b
4 changed files with 12 additions and 4 deletions

View File

@ -18,8 +18,10 @@ class CacheAvatarPreviewTest extends TestCase
public function testHandle()
{
option(['enable_avatar_cache' => true]);
$provider = new \App\Providers\EventServiceProvider(app());
$provider->boot();
Storage::fake('textures');
Event::listen(GetAvatarPreview::class, CacheAvatarPreview::class);
$texture = factory(Texture::class)->create();
Storage::disk('textures')

View File

@ -17,7 +17,9 @@ class CachePlayerExistsTest extends TestCase
public function setUp(): void
{
parent::setUp();
Event::subscribe(CachePlayerExists::class);
option(['enable_notfound_cache' => true]);
$provider = new \App\Providers\EventServiceProvider(app());
$provider->boot();
}
public function testRemember()

View File

@ -18,7 +18,9 @@ class CachePlayerJsonTest extends TestCase
public function setUp(): void
{
parent::setUp();
Event::subscribe(CachePlayerJson::class);
option(['enable_json_cache' => true]);
$provider = new \App\Providers\EventServiceProvider(app());
$provider->boot();
}
public function testRemember()

View File

@ -18,8 +18,10 @@ class CacheSkinPreviewTest extends TestCase
public function testHandle()
{
option(['enable_preview_cache' => true]);
$provider = new \App\Providers\EventServiceProvider(app());
$provider->boot();
Storage::fake('textures');
Event::listen(GetSkinPreview::class, CacheSkinPreview::class);
$skin = factory(Texture::class)->create();
Storage::disk('textures')