Commit b163e443 authored by Gabriel Caruso's avatar Gabriel Caruso

Refactoring tests

parent c62cfba1
...@@ -88,7 +88,7 @@ class ApplicationTest extends TestCase ...@@ -88,7 +88,7 @@ class ApplicationTest extends TestCase
$routes = $app['routes']; $routes = $app['routes'];
$this->assertInstanceOf('Symfony\Component\Routing\RouteCollection', $routes); $this->assertInstanceOf('Symfony\Component\Routing\RouteCollection', $routes);
$this->assertEquals(0, count($routes->all())); $this->assertCount(0, $routes->all());
} }
public function testGetRoutesWithRoutes() public function testGetRoutesWithRoutes()
...@@ -105,9 +105,9 @@ class ApplicationTest extends TestCase ...@@ -105,9 +105,9 @@ class ApplicationTest extends TestCase
$routes = $app['routes']; $routes = $app['routes'];
$this->assertInstanceOf('Symfony\Component\Routing\RouteCollection', $routes); $this->assertInstanceOf('Symfony\Component\Routing\RouteCollection', $routes);
$this->assertEquals(0, count($routes->all())); $this->assertCount(0, $routes->all());
$app->flush(); $app->flush();
$this->assertEquals(2, count($routes->all())); $this->assertCount(2, $routes->all());
} }
public function testOnCoreController() public function testOnCoreController()
......
...@@ -30,7 +30,7 @@ class ControllerCollectionTest extends TestCase ...@@ -30,7 +30,7 @@ class ControllerCollectionTest extends TestCase
{ {
$controllers = new ControllerCollection(new Route()); $controllers = new ControllerCollection(new Route());
$routes = $controllers->flush(); $routes = $controllers->flush();
$this->assertEquals(0, count($routes->all())); $this->assertCount(0, $routes->all());
} }
public function testGetRouteCollectionWithRoutes() public function testGetRouteCollectionWithRoutes()
...@@ -40,7 +40,7 @@ class ControllerCollectionTest extends TestCase ...@@ -40,7 +40,7 @@ class ControllerCollectionTest extends TestCase
$controllers->match('/bar', function () {}); $controllers->match('/bar', function () {});
$routes = $controllers->flush(); $routes = $controllers->flush();
$this->assertEquals(2, count($routes->all())); $this->assertCount(2, $routes->all());
} }
public function testControllerFreezing() public function testControllerFreezing()
......
...@@ -88,7 +88,7 @@ class DoctrineServiceProviderTest extends TestCase ...@@ -88,7 +88,7 @@ class DoctrineServiceProviderTest extends TestCase
} }
$app = new Application(); $app = new Application();
$this->assertTrue(isset($app['logger'])); $this->assertArrayHasKey('logger', $app);
$this->assertNull($app['logger']); $this->assertNull($app['logger']);
$app->register(new DoctrineServiceProvider(), array( $app->register(new DoctrineServiceProvider(), array(
'dbs.options' => array( 'dbs.options' => array(
......
...@@ -110,8 +110,8 @@ class ValidatorServiceProviderTest extends TestCase ...@@ -110,8 +110,8 @@ class ValidatorServiceProviderTest extends TestCase
$form->submit(array('email' => $email)); $form->submit(array('email' => $email));
$this->assertEquals($isValid, $form->isValid()); $this->assertEquals($isValid, $form->isValid());
$this->assertEquals($nbGlobalError, count($form->getErrors())); $this->assertCount($nbGlobalError, $form->getErrors());
$this->assertEquals($nbEmailError, count($form->offsetGet('email')->getErrors())); $this->assertCount($nbEmailError, $form->offsetGet('email')->getErrors());
} }
public function testValidatorWillNotAddNonexistentTranslationFiles() public function testValidatorWillNotAddNonexistentTranslationFiles()
......
...@@ -28,7 +28,7 @@ class StreamTest extends TestCase ...@@ -28,7 +28,7 @@ class StreamTest extends TestCase
$response = $app->stream(); $response = $app->stream();
$this->assertInstanceOf('Symfony\Component\HttpFoundation\StreamedResponse', $response); $this->assertInstanceOf('Symfony\Component\HttpFoundation\StreamedResponse', $response);
$this->assertSame(false, $response->getContent()); $this->assertFalse($response->getContent());
} }
public function testStreamActuallyStreams() public function testStreamActuallyStreams()
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment