From b4d64162e0cd58d122f990e8c7ec33554551f049 Mon Sep 17 00:00:00 2001 From: Benson Lee Date: Wed, 18 May 2016 06:08:08 -0700 Subject: [PATCH] Fix namespace usage in `SupportCollectionTest` (#13593) * Use base collection class, not Eloquent version * Use class constant to minimize future namespace errors --- tests/Support/SupportCollectionTest.php | 18 +++++++++--------- 1 file changed, 9 insertions(+), 9 deletions(-) diff --git a/tests/Support/SupportCollectionTest.php b/tests/Support/SupportCollectionTest.php index 6e55352dd805..d347b7ba5e9a 100755 --- a/tests/Support/SupportCollectionTest.php +++ b/tests/Support/SupportCollectionTest.php @@ -137,7 +137,7 @@ public function testJsonSerializeCallsToArrayOrJsonSerializeOnEachItemInCollecti public function testToJsonEncodesTheJsonSerializeResult() { - $c = $this->getMock('Illuminate\Support\Collection', ['jsonSerialize']); + $c = $this->getMock(Collection::class, ['jsonSerialize']); $c->expects($this->once())->method('jsonSerialize')->will($this->returnValue('foo')); $results = $c->toJson(); @@ -146,7 +146,7 @@ public function testToJsonEncodesTheJsonSerializeResult() public function testCastingToStringJsonEncodesTheToArrayResult() { - $c = $this->getMock('Illuminate\Database\Eloquent\Collection', ['jsonSerialize']); + $c = $this->getMock(Collection::class, ['jsonSerialize']); $c->expects($this->once())->method('jsonSerialize')->will($this->returnValue('foo')); $this->assertJsonStringEqualsJsonString(json_encode('foo'), (string) $c); @@ -551,8 +551,8 @@ public function testChunk() $data = new Collection([1, 2, 3, 4, 5, 6, 7, 8, 9, 10]); $data = $data->chunk(3); - $this->assertInstanceOf('Illuminate\Support\Collection', $data); - $this->assertInstanceOf('Illuminate\Support\Collection', $data[0]); + $this->assertInstanceOf(Collection::class, $data); + $this->assertInstanceOf(Collection::class, $data[0]); $this->assertCount(4, $data); $this->assertEquals([1, 2, 3], $data[0]->toArray()); $this->assertEquals([9 => 10], $data[3]->toArray()); @@ -631,7 +631,7 @@ public function testRandom() $this->assertContains($random, $data->all()); $random = $data->random(3); - $this->assertInstanceOf('Illuminate\Support\Collection', $random); + $this->assertInstanceOf(Collection::class, $random); $this->assertCount(3, $random); } @@ -1091,10 +1091,10 @@ public function testZip() { $c = new Collection([1, 2, 3]); $c = $c->zip(new Collection([4, 5, 6])); - $this->assertInstanceOf('Illuminate\Support\Collection', $c); - $this->assertInstanceOf('Illuminate\Support\Collection', $c[0]); - $this->assertInstanceOf('Illuminate\Support\Collection', $c[1]); - $this->assertInstanceOf('Illuminate\Support\Collection', $c[2]); + $this->assertInstanceOf(Collection::class, $c); + $this->assertInstanceOf(Collection::class, $c[0]); + $this->assertInstanceOf(Collection::class, $c[1]); + $this->assertInstanceOf(Collection::class, $c[2]); $this->assertCount(3, $c); $this->assertEquals([1, 4], $c[0]->all()); $this->assertEquals([2, 5], $c[1]->all());