Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion tests/Container/ContainerTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -506,7 +506,7 @@ public function testContainerTags()

$container = new Container;
$container->tag(['ContainerImplementationStub', 'ContainerImplementationStubTwo'], ['foo']);
$this->assertEquals(2, count($container->tagged('foo')));
$this->assertCount(2, $container->tagged('foo'));
$this->assertInstanceOf('ContainerImplementationStub', $container->tagged('foo')[0]);
$this->assertInstanceOf('ContainerImplementationStubTwo', $container->tagged('foo')[1]);

Expand Down
4 changes: 2 additions & 2 deletions tests/Cookie/Middleware/EncryptCookiesTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@ public function testSetCookieEncryption()
$response = $this->router->dispatch(Request::create($this->setCookiePath, 'GET'));

$cookies = $response->headers->getCookies();
$this->assertEquals(2, count($cookies));
$this->assertCount(2, $cookies);
$this->assertEquals('encrypted_cookie', $cookies[0]->getName());
$this->assertNotEquals('value', $cookies[0]->getValue());
$this->assertEquals('unencrypted_cookie', $cookies[1]->getName());
Expand All @@ -62,7 +62,7 @@ public function testQueuedCookieEncryption()
$response = $this->router->dispatch(Request::create($this->queueCookiePath, 'GET'));

$cookies = $response->headers->getCookies();
$this->assertEquals(2, count($cookies));
$this->assertCount(2, $cookies);
$this->assertEquals('encrypted_cookie', $cookies[0]->getName());
$this->assertNotEquals('value', $cookies[0]->getValue());
$this->assertEquals('unencrypted_cookie', $cookies[1]->getName());
Expand Down
4 changes: 2 additions & 2 deletions tests/Http/HttpRedirectResponseTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -35,10 +35,10 @@ public function testWithOnRedirect()
public function testWithCookieOnRedirect()
{
$response = new RedirectResponse('foo.bar');
$this->assertEquals(0, count($response->headers->getCookies()));
$this->assertCount(0, $response->headers->getCookies());
$this->assertEquals($response, $response->withCookie(new Symfony\Component\HttpFoundation\Cookie('foo', 'bar')));
$cookies = $response->headers->getCookies();
$this->assertEquals(1, count($cookies));
$this->assertCount(1, $cookies);
$this->assertEquals('foo', $cookies[0]->getName());
$this->assertEquals('bar', $cookies[0]->getValue());
}
Expand Down
4 changes: 2 additions & 2 deletions tests/Http/HttpResponseTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -51,10 +51,10 @@ public function testHeader()
public function testWithCookie()
{
$response = new Illuminate\Http\Response();
$this->assertEquals(0, count($response->headers->getCookies()));
$this->assertCount(0, $response->headers->getCookies());
$this->assertEquals($response, $response->withCookie(new Symfony\Component\HttpFoundation\Cookie('foo', 'bar')));
$cookies = $response->headers->getCookies();
$this->assertEquals(1, count($cookies));
$this->assertCount(1, $cookies);
$this->assertEquals('foo', $cookies[0]->getName());
$this->assertEquals('bar', $cookies[0]->getValue());
}
Expand Down
2 changes: 1 addition & 1 deletion tests/Redis/RedisConnectionTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ public function testRedisClusterNotCreateClusterAndOptionsServer()
$redis = $this->getRedis(true);
$client = $redis->connection();

$this->assertEquals(1, $client->getConnection()->count());
$this->assertCount(1, $client->getConnection());
}

protected function getRedis($cluster = false)
Expand Down
2 changes: 1 addition & 1 deletion tests/Routing/RouteCollectionTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@ public function testRouteCollectionAddRouteChangesCount()
'uses' => 'FooController@index',
'as' => 'foo_index',
]));
$this->assertSame(1, $this->routeCollection->count());
$this->assertCount(1, $this->routeCollection);
}

public function testRouteCollectionIsCountable()
Expand Down
8 changes: 4 additions & 4 deletions tests/Support/SupportCollectionTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -535,7 +535,7 @@ public function testChunk()

$this->assertInstanceOf('Illuminate\Support\Collection', $data);
$this->assertInstanceOf('Illuminate\Support\Collection', $data[0]);
$this->assertEquals(4, $data->count());
$this->assertCount(4, $data);
$this->assertEquals([1, 2, 3], $data[0]->toArray());
$this->assertEquals([9 => 10], $data[3]->toArray());
}
Expand Down Expand Up @@ -1077,21 +1077,21 @@ public function testZip()
$this->assertInstanceOf('Illuminate\Support\Collection', $c[0]);
$this->assertInstanceOf('Illuminate\Support\Collection', $c[1]);
$this->assertInstanceOf('Illuminate\Support\Collection', $c[2]);
$this->assertEquals(3, $c->count());
$this->assertCount(3, $c);
$this->assertEquals([1, 4], $c[0]->all());
$this->assertEquals([2, 5], $c[1]->all());
$this->assertEquals([3, 6], $c[2]->all());

$c = new Collection([1, 2, 3]);
$c = $c->zip([4, 5, 6], [7, 8, 9]);
$this->assertEquals(3, $c->count());
$this->assertCount(3, $c);
$this->assertEquals([1, 4, 7], $c[0]->all());
$this->assertEquals([2, 5, 8], $c[1]->all());
$this->assertEquals([3, 6, 9], $c[2]->all());

$c = new Collection([1, 2, 3]);
$c = $c->zip([4, 5, 6], [7]);
$this->assertEquals(3, $c->count());
$this->assertCount(3, $c);
$this->assertEquals([1, 4, 7], $c[0]->all());
$this->assertEquals([2, 5, null], $c[1]->all());
$this->assertEquals([3, 6, null], $c[2]->all());
Expand Down
4 changes: 2 additions & 2 deletions tests/Support/SupportMessageBagTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -123,13 +123,13 @@ public function testMessageBagReturnsExpectedJson()
public function testCountReturnsCorrectValue()
{
$container = new MessageBag;
$this->assertEquals(0, $container->count());
$this->assertCount(0, $container);

$container->add('foo', 'bar');
$container->add('foo', 'baz');
$container->add('boom', 'baz');

$this->assertEquals(3, $container->count());
$this->assertCount(3, $container);
}

public function testCountable()
Expand Down