Skip to content

Commit cfcbad9

Browse files
carusogabrieltaylorotwell
authored andcommitted
Refactoring tests (#22226)
1 parent 2404af8 commit cfcbad9

File tree

4 files changed

+12
-12
lines changed

4 files changed

+12
-12
lines changed

tests/Http/HttpMimeTypeTest.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -36,6 +36,6 @@ public function testGetAllMimeTypes()
3636
public function testSearchExtensionFromMimeType()
3737
{
3838
$this->assertSame('mov', MimeType::search('video/quicktime'));
39-
$this->assertSame(null, MimeType::search('foo/bar'));
39+
$this->assertNull(MimeType::search('foo/bar'));
4040
}
4141
}

tests/Support/SupportArrTest.php

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -68,14 +68,14 @@ public function testCrossJoin()
6868
);
6969

7070
// With 1 empty dimension
71-
$this->assertSame([], Arr::crossJoin([], ['a', 'b'], ['I', 'II', 'III']));
72-
$this->assertSame([], Arr::crossJoin([1, 2], [], ['I', 'II', 'III']));
73-
$this->assertSame([], Arr::crossJoin([1, 2], ['a', 'b'], []));
71+
$this->assertEmpty(Arr::crossJoin([], ['a', 'b'], ['I', 'II', 'III']));
72+
$this->assertEmpty(Arr::crossJoin([1, 2], [], ['I', 'II', 'III']));
73+
$this->assertEmpty(Arr::crossJoin([1, 2], ['a', 'b'], []));
7474

7575
// With empty arrays
76-
$this->assertSame([], Arr::crossJoin([], [], []));
77-
$this->assertSame([], Arr::crossJoin([], []));
78-
$this->assertSame([], Arr::crossJoin([]));
76+
$this->assertEmpty(Arr::crossJoin([], [], []));
77+
$this->assertEmpty(Arr::crossJoin([], []));
78+
$this->assertEmpty(Arr::crossJoin([]));
7979

8080
// Not really a proper usage, still, test for preserving BC
8181
$this->assertSame([[]], Arr::crossJoin());
@@ -269,8 +269,8 @@ public function testGet()
269269
$this->assertSame('default', Arr::get(null, null, 'default'));
270270

271271
// Test $array is empty and key is null
272-
$this->assertSame([], Arr::get([], null));
273-
$this->assertSame([], Arr::get([], null, 'default'));
272+
$this->assertEmpty(Arr::get([], null));
273+
$this->assertEmpty(Arr::get([], null, 'default'));
274274
}
275275

276276
public function testHas()

tests/Support/SupportCollectionTest.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -123,10 +123,10 @@ public function testCollectionIsConstructed()
123123
$this->assertSame([false], $collection->all());
124124

125125
$collection = new Collection(null);
126-
$this->assertSame([], $collection->all());
126+
$this->assertEmpty($collection->all());
127127

128128
$collection = new Collection;
129-
$this->assertSame([], $collection->all());
129+
$this->assertEmpty($collection->all());
130130
}
131131

132132
public function testGetArrayableItems()

tests/Support/SupportHelpersTest.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -124,7 +124,7 @@ public function testArrayOnly()
124124
{
125125
$array = ['name' => 'taylor', 'age' => 26];
126126
$this->assertEquals(['name' => 'taylor'], Arr::only($array, ['name']));
127-
$this->assertSame([], Arr::only($array, ['nonExistingKey']));
127+
$this->assertEmpty(Arr::only($array, ['nonExistingKey']));
128128
}
129129

130130
public function testArrayCollapse()

0 commit comments

Comments
 (0)