Skip to content

Commit b1d6eed

Browse files
Use assertCount
1 parent a7d3cd1 commit b1d6eed

5 files changed

Lines changed: 10 additions & 10 deletions

File tree

tests/Container/ContainerTest.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -435,8 +435,8 @@ public function testContainerTags()
435435
$container->tag('ContainerImplementationStub', 'foo', 'bar');
436436
$container->tag('ContainerImplementationStubTwo', ['foo']);
437437

438-
$this->assertEquals(1, count($container->tagged('bar')));
439-
$this->assertEquals(2, count($container->tagged('foo')));
438+
$this->assertCount(1, $container->tagged('bar'));
439+
$this->assertCount(2, $container->tagged('foo'));
440440
$this->assertInstanceOf('ContainerImplementationStub', $container->tagged('foo')[0]);
441441
$this->assertInstanceOf('ContainerImplementationStub', $container->tagged('bar')[0]);
442442
$this->assertInstanceOf('ContainerImplementationStubTwo', $container->tagged('foo')[1]);

tests/Database/DatabaseEloquentModelTest.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -75,7 +75,7 @@ public function testHydrateCreatesCollectionOfModels()
7575
$collection = EloquentModelStub::hydrate($data);
7676

7777
$this->assertInstanceOf('Illuminate\Database\Eloquent\Collection', $collection);
78-
$this->assertEquals(2, count($collection));
78+
$this->assertCount(2, $collection);
7979
$this->assertInstanceOf('EloquentModelStub', $collection[0]);
8080
$this->assertInstanceOf('EloquentModelStub', $collection[1]);
8181
$this->assertEquals('Taylor', $collection[0]->name);

tests/Routing/RoutingRouteTest.php

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -664,19 +664,19 @@ public function testResourceRouting()
664664
$router = $this->getRouter();
665665
$router->resource('foo', 'FooController');
666666
$routes = $router->getRoutes();
667-
$this->assertEquals(8, count($routes));
667+
$this->assertCount(8, $routes);
668668

669669
$router = $this->getRouter();
670670
$router->resource('foo', 'FooController', array('only' => array('show', 'destroy')));
671671
$routes = $router->getRoutes();
672672

673-
$this->assertEquals(2, count($routes));
673+
$this->assertCount(2, $routes);
674674

675675
$router = $this->getRouter();
676676
$router->resource('foo', 'FooController', array('except' => array('show', 'destroy')));
677677
$routes = $router->getRoutes();
678678

679-
$this->assertEquals(6, count($routes));
679+
$this->assertCount(6, $routes);
680680

681681
$router = $this->getRouter();
682682
$router->resource('foo-bars', 'FooController', array('only' => array('show')));

tests/Support/SupportCollectionTest.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -95,7 +95,7 @@ public function testOffsetAccess()
9595
public function testCountable()
9696
{
9797
$c = new Collection(array('foo', 'bar'));
98-
$this->assertEquals(2, count($c));
98+
$this->assertCount(2, $c);
9999
}
100100

101101

@@ -253,7 +253,7 @@ public function testFlip()
253253
}
254254

255255

256-
public function testChunk ()
256+
public function testChunk()
257257
{
258258
$data = new Collection(array(1, 2, 3, 4, 5, 6, 7, 8, 9, 10));
259259
$data = $data->chunk(3);

tests/View/ViewFactoryTest.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -334,11 +334,11 @@ public function testSectionFlushing()
334334
echo 'hi';
335335
$factory->stopSection();
336336

337-
$this->assertEquals(1, count($factory->getSections()));
337+
$this->assertCount(1, $factory->getSections());
338338

339339
$factory->flushSections();
340340

341-
$this->assertEquals(0, count($factory->getSections()));
341+
$this->assertCount(0, $factory->getSections());
342342
}
343343

344344

0 commit comments

Comments
 (0)