From bbdd75ad444095d877ce0e4ebf8e7302fce9c644 Mon Sep 17 00:00:00 2001 From: Pig Fang Date: Wed, 7 Aug 2019 15:46:34 +0800 Subject: [PATCH] Remove deprecated `assertArraySubset` --- tests/SkinlibControllerTest.php | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) diff --git a/tests/SkinlibControllerTest.php b/tests/SkinlibControllerTest.php index ca6bee91..152f9aaf 100644 --- a/tests/SkinlibControllerTest.php +++ b/tests/SkinlibControllerTest.php @@ -97,7 +97,7 @@ class SkinlibControllerTest extends TestCase // Sort by `tid` $ordered = $skins->sortByDesc('tid')->map(function ($skin) { return $skin->tid; - })->values(); + })->values()->all(); $items = $this->getJson('/skinlib/data?sort=tid') ->assertJson(['data' => [ 'current_uid' => 0, @@ -107,7 +107,7 @@ class SkinlibControllerTest extends TestCase $items = array_map(function ($item) { return $item['tid']; }, $items); - $this->assertArraySubset($ordered, $items); + $this->assertEquals($ordered, $items); // Search $keyword = Str::limit($skins->random()->name, 1, ''); @@ -135,7 +135,8 @@ class SkinlibControllerTest extends TestCase ->map(function ($skin) { return $skin->tid; }) - ->values(); + ->values() + ->all(); $items = $this->getJson('/skinlib/data?sort=size&keyword='.$keyword) ->assertJson(['data' => [ 'current_uid' => 0, @@ -145,8 +146,8 @@ class SkinlibControllerTest extends TestCase $items = array_map(function ($item) { return $item['tid']; }, $items); - $this->assertCount($filtered->count(), $items); - $this->assertArraySubset($filtered, $items); + $this->assertCount(count($filtered), $items); + $this->assertEquals($filtered, $items); // Pagination $steves = factory(Texture::class)