Commit 12c5c927 authored by Fabien Potencier's avatar Fabien Potencier

minor #1515 Use PHPUnit\Framework\TestCase in Silex tests (skalpa)

This PR was squashed before being merged into the 2.1.x-dev branch (closes #1515).

Discussion
----------

Use PHPUnit\Framework\TestCase in Silex tests

I changed all the tests so they use the namespaced class instead of `PHPUnit_Framework_TestCase`.

That doesn't really bring anything, but will be one less thing to change when Silex switches to PHP7/PHPUnit 6.

Commits
-------

f8731dad Use PHPUnit\Framework\TestCase in Silex tests
parents 916ab5f8 f8731dad
...@@ -11,6 +11,7 @@ ...@@ -11,6 +11,7 @@
namespace Silex\Tests\Application; namespace Silex\Tests\Application;
use PHPUnit\Framework\TestCase;
use Silex\Provider\FormServiceProvider; use Silex\Provider\FormServiceProvider;
/** /**
...@@ -18,7 +19,7 @@ use Silex\Provider\FormServiceProvider; ...@@ -18,7 +19,7 @@ use Silex\Provider\FormServiceProvider;
* *
* @author Fabien Potencier <fabien@symfony.com> * @author Fabien Potencier <fabien@symfony.com>
*/ */
class FormTraitTest extends \PHPUnit_Framework_TestCase class FormTraitTest extends TestCase
{ {
public function testForm() public function testForm()
{ {
......
...@@ -11,6 +11,7 @@ ...@@ -11,6 +11,7 @@
namespace Silex\Tests\Application; namespace Silex\Tests\Application;
use PHPUnit\Framework\TestCase;
use Silex\Provider\MonologServiceProvider; use Silex\Provider\MonologServiceProvider;
use Monolog\Handler\TestHandler; use Monolog\Handler\TestHandler;
use Monolog\Logger; use Monolog\Logger;
...@@ -20,7 +21,7 @@ use Monolog\Logger; ...@@ -20,7 +21,7 @@ use Monolog\Logger;
* *
* @author Fabien Potencier <fabien@symfony.com> * @author Fabien Potencier <fabien@symfony.com>
*/ */
class MonologTraitTest extends \PHPUnit_Framework_TestCase class MonologTraitTest extends TestCase
{ {
public function testLog() public function testLog()
{ {
......
...@@ -11,6 +11,7 @@ ...@@ -11,6 +11,7 @@
namespace Silex\Tests\Application; namespace Silex\Tests\Application;
use PHPUnit\Framework\TestCase;
use Silex\Provider\SecurityServiceProvider; use Silex\Provider\SecurityServiceProvider;
use Symfony\Component\Security\Core\User\User; use Symfony\Component\Security\Core\User\User;
use Symfony\Component\HttpFoundation\Request; use Symfony\Component\HttpFoundation\Request;
...@@ -20,7 +21,7 @@ use Symfony\Component\HttpFoundation\Request; ...@@ -20,7 +21,7 @@ use Symfony\Component\HttpFoundation\Request;
* *
* @author Fabien Potencier <fabien@symfony.com> * @author Fabien Potencier <fabien@symfony.com>
*/ */
class SecurityTraitTest extends \PHPUnit_Framework_TestCase class SecurityTraitTest extends TestCase
{ {
public function testEncodePassword() public function testEncodePassword()
{ {
......
...@@ -11,6 +11,7 @@ ...@@ -11,6 +11,7 @@
namespace Silex\Tests\Application; namespace Silex\Tests\Application;
use PHPUnit\Framework\TestCase;
use Silex\Provider\SwiftmailerServiceProvider; use Silex\Provider\SwiftmailerServiceProvider;
/** /**
...@@ -18,7 +19,7 @@ use Silex\Provider\SwiftmailerServiceProvider; ...@@ -18,7 +19,7 @@ use Silex\Provider\SwiftmailerServiceProvider;
* *
* @author Fabien Potencier <fabien@symfony.com> * @author Fabien Potencier <fabien@symfony.com>
*/ */
class SwiftmailerTraitTest extends \PHPUnit_Framework_TestCase class SwiftmailerTraitTest extends TestCase
{ {
public function testMail() public function testMail()
{ {
......
...@@ -11,6 +11,7 @@ ...@@ -11,6 +11,7 @@
namespace Silex\Tests\Application; namespace Silex\Tests\Application;
use PHPUnit\Framework\TestCase;
use Silex\Provider\TranslationServiceProvider; use Silex\Provider\TranslationServiceProvider;
/** /**
...@@ -18,7 +19,7 @@ use Silex\Provider\TranslationServiceProvider; ...@@ -18,7 +19,7 @@ use Silex\Provider\TranslationServiceProvider;
* *
* @author Fabien Potencier <fabien@symfony.com> * @author Fabien Potencier <fabien@symfony.com>
*/ */
class TranslationTraitTest extends \PHPUnit_Framework_TestCase class TranslationTraitTest extends TestCase
{ {
public function testTrans() public function testTrans()
{ {
......
...@@ -11,6 +11,7 @@ ...@@ -11,6 +11,7 @@
namespace Silex\Tests\Application; namespace Silex\Tests\Application;
use PHPUnit\Framework\TestCase;
use Silex\Provider\TwigServiceProvider; use Silex\Provider\TwigServiceProvider;
use Symfony\Component\HttpFoundation\Response; use Symfony\Component\HttpFoundation\Response;
use Symfony\Component\HttpFoundation\StreamedResponse; use Symfony\Component\HttpFoundation\StreamedResponse;
...@@ -20,7 +21,7 @@ use Symfony\Component\HttpFoundation\StreamedResponse; ...@@ -20,7 +21,7 @@ use Symfony\Component\HttpFoundation\StreamedResponse;
* *
* @author Fabien Potencier <fabien@symfony.com> * @author Fabien Potencier <fabien@symfony.com>
*/ */
class TwigTraitTest extends \PHPUnit_Framework_TestCase class TwigTraitTest extends TestCase
{ {
public function testRender() public function testRender()
{ {
......
...@@ -11,6 +11,7 @@ ...@@ -11,6 +11,7 @@
namespace Silex\Tests\Application; namespace Silex\Tests\Application;
use PHPUnit\Framework\TestCase;
use Symfony\Component\Routing\Generator\UrlGeneratorInterface; use Symfony\Component\Routing\Generator\UrlGeneratorInterface;
/** /**
...@@ -18,7 +19,7 @@ use Symfony\Component\Routing\Generator\UrlGeneratorInterface; ...@@ -18,7 +19,7 @@ use Symfony\Component\Routing\Generator\UrlGeneratorInterface;
* *
* @author Fabien Potencier <fabien@symfony.com> * @author Fabien Potencier <fabien@symfony.com>
*/ */
class UrlGeneratorTraitTest extends \PHPUnit_Framework_TestCase class UrlGeneratorTraitTest extends TestCase
{ {
public function testUrl() public function testUrl()
{ {
......
...@@ -13,6 +13,7 @@ namespace Silex\Tests; ...@@ -13,6 +13,7 @@ namespace Silex\Tests;
use Fig\Link\GenericLinkProvider; use Fig\Link\GenericLinkProvider;
use Fig\Link\Link; use Fig\Link\Link;
use PHPUnit\Framework\TestCase;
use Silex\Application; use Silex\Application;
use Silex\ControllerCollection; use Silex\ControllerCollection;
use Silex\Api\ControllerProviderInterface; use Silex\Api\ControllerProviderInterface;
...@@ -30,7 +31,7 @@ use Symfony\Component\Routing\RouteCollection; ...@@ -30,7 +31,7 @@ use Symfony\Component\Routing\RouteCollection;
* *
* @author Igor Wiedler <igor@wiedler.ch> * @author Igor Wiedler <igor@wiedler.ch>
*/ */
class ApplicationTest extends \PHPUnit_Framework_TestCase class ApplicationTest extends TestCase
{ {
public function testMatchReturnValue() public function testMatchReturnValue()
{ {
......
...@@ -11,10 +11,11 @@ ...@@ -11,10 +11,11 @@
namespace Silex\Tests; namespace Silex\Tests;
use PHPUnit\Framework\TestCase;
use Pimple\Container; use Pimple\Container;
use Silex\CallbackResolver; use Silex\CallbackResolver;
class CallbackResolverTest extends \PHPUnit_Framework_Testcase class CallbackResolverTest extends Testcase
{ {
private $app; private $app;
private $resolver; private $resolver;
......
...@@ -11,6 +11,7 @@ ...@@ -11,6 +11,7 @@
namespace Silex\Tests; namespace Silex\Tests;
use PHPUnit\Framework\TestCase;
use Silex\Application; use Silex\Application;
use Symfony\Component\HttpFoundation\Request; use Symfony\Component\HttpFoundation\Request;
use Silex\Provider\ServiceControllerServiceProvider; use Silex\Provider\ServiceControllerServiceProvider;
...@@ -20,7 +21,7 @@ use Silex\Provider\ServiceControllerServiceProvider; ...@@ -20,7 +21,7 @@ use Silex\Provider\ServiceControllerServiceProvider;
* *
* @author Fabien Potencier <fabien@symfony.com> * @author Fabien Potencier <fabien@symfony.com>
*/ */
class CallbackServicesTest extends \PHPUnit_Framework_TestCase class CallbackServicesTest extends TestCase
{ {
public $called = array(); public $called = array();
......
...@@ -11,6 +11,7 @@ ...@@ -11,6 +11,7 @@
namespace Silex\Tests; namespace Silex\Tests;
use PHPUnit\Framework\TestCase;
use Silex\Application; use Silex\Application;
use Silex\Controller; use Silex\Controller;
use Silex\ControllerCollection; use Silex\ControllerCollection;
...@@ -23,7 +24,7 @@ use Symfony\Component\Routing\RouteCollection; ...@@ -23,7 +24,7 @@ use Symfony\Component\Routing\RouteCollection;
* *
* @author Igor Wiedler <igor@wiedler.ch> * @author Igor Wiedler <igor@wiedler.ch>
*/ */
class ControllerCollectionTest extends \PHPUnit_Framework_TestCase class ControllerCollectionTest extends TestCase
{ {
public function testGetRouteCollectionWithNoRoutes() public function testGetRouteCollectionWithNoRoutes()
{ {
......
...@@ -11,6 +11,7 @@ ...@@ -11,6 +11,7 @@
namespace Silex\Tests; namespace Silex\Tests;
use PHPUnit\Framework\TestCase;
use Silex\ControllerResolver; use Silex\ControllerResolver;
use Silex\Application; use Silex\Application;
use Symfony\Component\HttpFoundation\Request; use Symfony\Component\HttpFoundation\Request;
...@@ -20,7 +21,7 @@ use Symfony\Component\HttpFoundation\Request; ...@@ -20,7 +21,7 @@ use Symfony\Component\HttpFoundation\Request;
* *
* @author Fabien Potencier <fabien@symfony.com> * @author Fabien Potencier <fabien@symfony.com>
*/ */
class ControllerResolverTest extends \PHPUnit_Framework_TestCase class ControllerResolverTest extends TestCase
{ {
/** /**
* @group legacy * @group legacy
......
...@@ -11,6 +11,7 @@ ...@@ -11,6 +11,7 @@
namespace Silex\Tests; namespace Silex\Tests;
use PHPUnit\Framework\TestCase;
use Silex\Controller; use Silex\Controller;
use Silex\Route; use Silex\Route;
...@@ -19,7 +20,7 @@ use Silex\Route; ...@@ -19,7 +20,7 @@ use Silex\Route;
* *
* @author Igor Wiedler <igor@wiedler.ch> * @author Igor Wiedler <igor@wiedler.ch>
*/ */
class ControllerTest extends \PHPUnit_Framework_TestCase class ControllerTest extends TestCase
{ {
public function testBind() public function testBind()
{ {
......
...@@ -11,6 +11,7 @@ ...@@ -11,6 +11,7 @@
namespace Silex\Tests\EventListener; namespace Silex\Tests\EventListener;
use PHPUnit\Framework\TestCase;
use Psr\Log\LogLevel; use Psr\Log\LogLevel;
use Silex\EventListener\LogListener; use Silex\EventListener\LogListener;
use Symfony\Component\HttpKernel\Event\GetResponseEvent; use Symfony\Component\HttpKernel\Event\GetResponseEvent;
...@@ -28,7 +29,7 @@ use Symfony\Component\HttpKernel\Exception\HttpException; ...@@ -28,7 +29,7 @@ use Symfony\Component\HttpKernel\Exception\HttpException;
* *
* @author Jérôme Tamarelle <jerome@tamarelle.net> * @author Jérôme Tamarelle <jerome@tamarelle.net>
*/ */
class LogListenerTest extends \PHPUnit_Framework_TestCase class LogListenerTest extends TestCase
{ {
public function testRequestListener() public function testRequestListener()
{ {
......
...@@ -11,6 +11,7 @@ ...@@ -11,6 +11,7 @@
namespace Silex\Tests; namespace Silex\Tests;
use PHPUnit\Framework\TestCase;
use Silex\Application; use Silex\Application;
use Symfony\Component\HttpFoundation\Request; use Symfony\Component\HttpFoundation\Request;
use Symfony\Component\HttpFoundation\Response; use Symfony\Component\HttpFoundation\Response;
...@@ -21,7 +22,7 @@ use Symfony\Component\HttpKernel\Exception\NotFoundHttpException; ...@@ -21,7 +22,7 @@ use Symfony\Component\HttpKernel\Exception\NotFoundHttpException;
* *
* @author Igor Wiedler <igor@wiedler.ch> * @author Igor Wiedler <igor@wiedler.ch>
*/ */
class ExceptionHandlerTest extends \PHPUnit_Framework_TestCase class ExceptionHandlerTest extends TestCase
{ {
public function testExceptionHandlerExceptionNoDebug() public function testExceptionHandlerExceptionNoDebug()
{ {
...@@ -307,7 +308,6 @@ class ExceptionHandlerTest extends \PHPUnit_Framework_TestCase ...@@ -307,7 +308,6 @@ class ExceptionHandlerTest extends \PHPUnit_Framework_TestCase
// Since we throw a standard Exception above only // Since we throw a standard Exception above only
// the second error handler should fire // the second error handler should fire
$app->error(function (\LogicException $e) { // Extends \Exception $app->error(function (\LogicException $e) { // Extends \Exception
return 'Caught LogicException'; return 'Caught LogicException';
}); });
$app->error(function (\Exception $e) { $app->error(function (\Exception $e) {
...@@ -333,7 +333,6 @@ class ExceptionHandlerTest extends \PHPUnit_Framework_TestCase ...@@ -333,7 +333,6 @@ class ExceptionHandlerTest extends \PHPUnit_Framework_TestCase
// Since we throw a LogicException above // Since we throw a LogicException above
// the first error handler should fire // the first error handler should fire
$app->error(function (\LogicException $e) { // Extends \Exception $app->error(function (\LogicException $e) { // Extends \Exception
return 'Caught LogicException'; return 'Caught LogicException';
}); });
$app->error(function (\Exception $e) { $app->error(function (\Exception $e) {
...@@ -364,7 +363,6 @@ class ExceptionHandlerTest extends \PHPUnit_Framework_TestCase ...@@ -364,7 +363,6 @@ class ExceptionHandlerTest extends \PHPUnit_Framework_TestCase
return 'Caught Exception'; return 'Caught Exception';
}); });
$app->error(function (\LogicException $e) { // Extends \Exception $app->error(function (\LogicException $e) { // Extends \Exception
return 'Caught LogicException'; return 'Caught LogicException';
}); });
......
...@@ -11,6 +11,7 @@ ...@@ -11,6 +11,7 @@
namespace Silex\Tests; namespace Silex\Tests;
use PHPUnit\Framework\TestCase;
use Silex\Application; use Silex\Application;
use Silex\Route; use Silex\Route;
use Silex\ControllerCollection; use Silex\ControllerCollection;
...@@ -22,7 +23,7 @@ use Symfony\Component\HttpFoundation\Response; ...@@ -22,7 +23,7 @@ use Symfony\Component\HttpFoundation\Response;
* *
* @author Igor Wiedler <igor@wiedler.ch> * @author Igor Wiedler <igor@wiedler.ch>
*/ */
class FunctionalTest extends \PHPUnit_Framework_TestCase class FunctionalTest extends TestCase
{ {
public function testBind() public function testBind()
{ {
......
...@@ -11,6 +11,7 @@ ...@@ -11,6 +11,7 @@
namespace Silex\Tests; namespace Silex\Tests;
use PHPUnit\Framework\TestCase;
use Silex\Application; use Silex\Application;
/** /**
...@@ -18,7 +19,7 @@ use Silex\Application; ...@@ -18,7 +19,7 @@ use Silex\Application;
* *
* @author Igor Wiedler <igor@wiedler.ch> * @author Igor Wiedler <igor@wiedler.ch>
*/ */
class JsonTest extends \PHPUnit_Framework_TestCase class JsonTest extends TestCase
{ {
public function testJsonReturnsJsonResponse() public function testJsonReturnsJsonResponse()
{ {
......
...@@ -11,10 +11,11 @@ ...@@ -11,10 +11,11 @@
namespace Silex\Tests; namespace Silex\Tests;
use PHPUnit\Framework\TestCase;
use Silex\Application; use Silex\Application;
use Symfony\Component\HttpFoundation\Request; use Symfony\Component\HttpFoundation\Request;
class LazyDispatcherTest extends \PHPUnit_Framework_TestCase class LazyDispatcherTest extends TestCase
{ {
/** @test */ /** @test */
public function beforeMiddlewareShouldNotCreateDispatcherEarly() public function beforeMiddlewareShouldNotCreateDispatcherEarly()
......
...@@ -11,6 +11,7 @@ ...@@ -11,6 +11,7 @@
namespace Silex\Tests; namespace Silex\Tests;
use PHPUnit\Framework\TestCase;
use Symfony\Component\HttpFoundation\Request; use Symfony\Component\HttpFoundation\Request;
use Silex\Provider\Routing\LazyRequestMatcher; use Silex\Provider\Routing\LazyRequestMatcher;
...@@ -19,10 +20,10 @@ use Silex\Provider\Routing\LazyRequestMatcher; ...@@ -19,10 +20,10 @@ use Silex\Provider\Routing\LazyRequestMatcher;
* *
* @author Leszek Prabucki <leszek.prabucki@gmail.com> * @author Leszek Prabucki <leszek.prabucki@gmail.com>
*/ */
class LazyRequestMatcherTest extends \PHPUnit_Framework_TestCase class LazyRequestMatcherTest extends TestCase
{ {
/** /**
* @covers Silex\LazyRequestMatcher::getRequestMatcher * @covers \Silex\LazyRequestMatcher::getRequestMatcher
*/ */
public function testUserMatcherIsCreatedLazily() public function testUserMatcherIsCreatedLazily()
{ {
...@@ -42,7 +43,7 @@ class LazyRequestMatcherTest extends \PHPUnit_Framework_TestCase ...@@ -42,7 +43,7 @@ class LazyRequestMatcherTest extends \PHPUnit_Framework_TestCase
} }
/** /**
* @expectedException LogicException * @expectedException \LogicException
* @expectedExceptionMessage Factory supplied to LazyRequestMatcher must return implementation of Symfony\Component\Routing\RequestMatcherInterface. * @expectedExceptionMessage Factory supplied to LazyRequestMatcher must return implementation of Symfony\Component\Routing\RequestMatcherInterface.
*/ */
public function testThatCanInjectRequestMatcherOnly() public function testThatCanInjectRequestMatcherOnly()
...@@ -56,7 +57,7 @@ class LazyRequestMatcherTest extends \PHPUnit_Framework_TestCase ...@@ -56,7 +57,7 @@ class LazyRequestMatcherTest extends \PHPUnit_Framework_TestCase
} }
/** /**
* @covers Silex\LazyRequestMatcher::matchRequest * @covers \Silex\LazyRequestMatcher::matchRequest
*/ */
public function testMatchIsProxy() public function testMatchIsProxy()
{ {
......
...@@ -11,6 +11,7 @@ ...@@ -11,6 +11,7 @@
namespace Silex\Tests; namespace Silex\Tests;
use PHPUnit\Framework\TestCase;
use Silex\Application; use Silex\Application;
use Silex\Provider\LocaleServiceProvider; use Silex\Provider\LocaleServiceProvider;
use Symfony\Component\HttpFoundation\Request; use Symfony\Component\HttpFoundation\Request;
...@@ -21,7 +22,7 @@ use Symfony\Component\HttpKernel\HttpKernelInterface; ...@@ -21,7 +22,7 @@ use Symfony\Component\HttpKernel\HttpKernelInterface;
* *
* @author Fabien Potencier <fabien@symfony.com> * @author Fabien Potencier <fabien@symfony.com>
*/ */
class LocaleTest extends \PHPUnit_Framework_TestCase class LocaleTest extends TestCase
{ {
public function testLocale() public function testLocale()
{ {
......
...@@ -11,6 +11,7 @@ ...@@ -11,6 +11,7 @@
namespace Silex\Tests; namespace Silex\Tests;
use PHPUnit\Framework\TestCase;
use Silex\Application; use Silex\Application;
use Symfony\Component\HttpFoundation\Request; use Symfony\Component\HttpFoundation\Request;
use Symfony\Component\HttpFoundation\Response; use Symfony\Component\HttpFoundation\Response;
...@@ -20,7 +21,7 @@ use Symfony\Component\HttpFoundation\Response; ...@@ -20,7 +21,7 @@ use Symfony\Component\HttpFoundation\Response;
* *
* @author Igor Wiedler <igor@wiedler.ch> * @author Igor Wiedler <igor@wiedler.ch>
*/ */
class MiddlewareTest extends \PHPUnit_Framework_TestCase class MiddlewareTest extends TestCase
{ {
public function testBeforeAndAfterFilter() public function testBeforeAndAfterFilter()
{ {
......
...@@ -11,10 +11,11 @@ ...@@ -11,10 +11,11 @@
namespace Silex\Tests\Provider; namespace Silex\Tests\Provider;
use PHPUnit\Framework\TestCase;
use Silex\Application; use Silex\Application;
use Silex\Provider\AssetServiceProvider; use Silex\Provider\AssetServiceProvider;
class AssetServiceProviderTest extends \PHPUnit_Framework_TestCase class AssetServiceProviderTest extends TestCase
{ {
public function testGenerateAssetUrl() public function testGenerateAssetUrl()
{ {
......
...@@ -11,6 +11,7 @@ ...@@ -11,6 +11,7 @@
namespace Silex\Tests\Provider; namespace Silex\Tests\Provider;
use PHPUnit\Framework\TestCase;
use Pimple\Container; use Pimple\Container;
use Silex\Application; use Silex\Application;
use Silex\Provider\DoctrineServiceProvider; use Silex\Provider\DoctrineServiceProvider;
...@@ -20,7 +21,7 @@ use Silex\Provider\DoctrineServiceProvider; ...@@ -20,7 +21,7 @@ use Silex\Provider\DoctrineServiceProvider;
* *
* Fabien Potencier <fabien@symfony.com> * Fabien Potencier <fabien@symfony.com>
*/ */
class DoctrineServiceProviderTest extends \PHPUnit_Framework_TestCase class DoctrineServiceProviderTest extends TestCase
{ {
public function testOptionsInitializer() public function testOptionsInitializer()
{ {
...@@ -43,7 +44,7 @@ class DoctrineServiceProviderTest extends \PHPUnit_Framework_TestCase ...@@ -43,7 +44,7 @@ class DoctrineServiceProviderTest extends \PHPUnit_Framework_TestCase
$db = $app['db']; $db = $app['db'];
$params = $db->getParams(); $params = $db->getParams();
$this->assertTrue(array_key_exists('memory', $params)); $this->assertArrayHasKey('memory', $params);
$this->assertTrue($params['memory']); $this->assertTrue($params['memory']);
$this->assertInstanceof('Doctrine\DBAL\Driver\PDOSqlite\Driver', $db->getDriver()); $this->assertInstanceof('Doctrine\DBAL\Driver\PDOSqlite\Driver', $db->getDriver());
$this->assertEquals(22, $app['db']->fetchColumn('SELECT 22')); $this->assertEquals(22, $app['db']->fetchColumn('SELECT 22'));
...@@ -67,7 +68,7 @@ class DoctrineServiceProviderTest extends \PHPUnit_Framework_TestCase ...@@ -67,7 +68,7 @@ class DoctrineServiceProviderTest extends \PHPUnit_Framework_TestCase
$db = $app['db']; $db = $app['db'];
$params = $db->getParams(); $params = $db->getParams();
$this->assertTrue(array_key_exists('memory', $params)); $this->assertArrayHasKey('memory', $params);
$this->assertTrue($params['memory']); $this->assertTrue($params['memory']);
$this->assertInstanceof('Doctrine\DBAL\Driver\PDOSqlite\Driver', $db->getDriver()); $this->assertInstanceof('Doctrine\DBAL\Driver\PDOSqlite\Driver', $db->getDriver());
$this->assertEquals(22, $app['db']->fetchColumn('SELECT 22')); $this->assertEquals(22, $app['db']->fetchColumn('SELECT 22'));
...@@ -76,7 +77,7 @@ class DoctrineServiceProviderTest extends \PHPUnit_Framework_TestCase ...@@ -76,7 +77,7 @@ class DoctrineServiceProviderTest extends \PHPUnit_Framework_TestCase
$db2 = $app['dbs']['sqlite2']; $db2 = $app['dbs']['sqlite2'];
$params = $db2->getParams(); $params = $db2->getParams();
$this->assertTrue(array_key_exists('path', $params)); $this->assertArrayHasKey('path', $params);
$this->assertEquals(sys_get_temp_dir().'/silex', $params['path']); $this->assertEquals(sys_get_temp_dir().'/silex', $params['path']);
} }
......
...@@ -11,6 +11,7 @@ ...@@ -11,6 +11,7 @@
namespace Silex\Tests\Provider; namespace Silex\Tests\Provider;
use PHPUnit\Framework\TestCase;
use Silex\Application; use Silex\Application;
use Silex\Provider\FormServiceProvider; use Silex\Provider\FormServiceProvider;
use Silex\Provider\CsrfServiceProvider; use Silex\Provider\CsrfServiceProvider;
...@@ -25,7 +26,7 @@ use Symfony\Component\OptionsResolver\OptionsResolver; ...@@ -25,7 +26,7 @@ use Symfony\Component\OptionsResolver\OptionsResolver;
use Symfony\Component\OptionsResolver\OptionsResolverInterface; use Symfony\Component\OptionsResolver\OptionsResolverInterface;
use Symfony\Component\Translation\Exception\NotFoundResourceException; use Symfony\Component\Translation\Exception\NotFoundResourceException;
class FormServiceProviderTest extends \PHPUnit_Framework_TestCase class FormServiceProviderTest extends TestCase
{ {
public function testFormFactoryServiceIsFormFactory() public function testFormFactoryServiceIsFormFactory()
{ {
......
...@@ -11,6 +11,7 @@ ...@@ -11,6 +11,7 @@
namespace Silex\Tests\Provider; namespace Silex\Tests\Provider;
use PHPUnit\Framework\TestCase;
use Silex\Application; use Silex\Application;
use Silex\Provider\HttpCacheServiceProvider; use Silex\Provider\HttpCacheServiceProvider;
use Symfony\Component\HttpFoundation\Request; use Symfony\Component\HttpFoundation\Request;
...@@ -21,7 +22,7 @@ use Symfony\Component\HttpFoundation\Response; ...@@ -21,7 +22,7 @@ use Symfony\Component\HttpFoundation\Response;
* *
* @author Igor Wiedler <igor@wiedler.ch> * @author Igor Wiedler <igor@wiedler.ch>
*/ */
class HttpCacheServiceProviderTest extends \PHPUnit_Framework_TestCase class HttpCacheServiceProviderTest extends TestCase
{ {
public function testRegister() public function testRegister()
{ {
......
...@@ -11,13 +11,14 @@ ...@@ -11,13 +11,14 @@
namespace Silex\Tests\Provider; namespace Silex\Tests\Provider;
use PHPUnit\Framework\TestCase;
use Silex\Application; use Silex\Application;
use Silex\Provider\HttpCacheServiceProvider; use Silex\Provider\HttpCacheServiceProvider;
use Silex\Provider\HttpFragmentServiceProvider; use Silex\Provider\HttpFragmentServiceProvider;
use Silex\Provider\TwigServiceProvider; use Silex\Provider\TwigServiceProvider;
use Symfony\Component\HttpFoundation\Request; use Symfony\Component\HttpFoundation\Request;
class HttpFragmentServiceProviderTest extends \PHPUnit_Framework_TestCase class HttpFragmentServiceProviderTest extends TestCase
{ {
public function testRenderFunction() public function testRenderFunction()
{ {
......
...@@ -14,6 +14,7 @@ namespace Silex\Tests\Provider; ...@@ -14,6 +14,7 @@ namespace Silex\Tests\Provider;
use Monolog\Formatter\JsonFormatter; use Monolog\Formatter\JsonFormatter;
use Monolog\Handler\TestHandler; use Monolog\Handler\TestHandler;
use Monolog\Logger; use Monolog\Logger;
use PHPUnit\Framework\TestCase;
use Silex\Application; use Silex\Application;
use Silex\Provider\MonologServiceProvider; use Silex\Provider\MonologServiceProvider;
use Symfony\Component\HttpFoundation\RedirectResponse; use Symfony\Component\HttpFoundation\RedirectResponse;
...@@ -26,7 +27,7 @@ use Symfony\Component\HttpKernel\Kernel; ...@@ -26,7 +27,7 @@ use Symfony\Component\HttpKernel\Kernel;
* *
* @author Igor Wiedler <igor@wiedler.ch> * @author Igor Wiedler <igor@wiedler.ch>
*/ */
class MonologServiceProviderTest extends \PHPUnit_Framework_TestCase class MonologServiceProviderTest extends TestCase
{ {
private $currErrorHandler; private $currErrorHandler;
......
...@@ -11,6 +11,7 @@ ...@@ -11,6 +11,7 @@
namespace Silex\Tests\Provider; namespace Silex\Tests\Provider;
use PHPUnit\Framework\TestCase;
use Pimple\Container; use Pimple\Container;
use Silex\Application; use Silex\Application;
use Silex\Provider\RoutingServiceProvider; use Silex\Provider\RoutingServiceProvider;
...@@ -22,7 +23,7 @@ use Symfony\Component\Routing\Generator\UrlGeneratorInterface; ...@@ -22,7 +23,7 @@ use Symfony\Component\Routing\Generator\UrlGeneratorInterface;
* *
* @author Igor Wiedler <igor@wiedler.ch> * @author Igor Wiedler <igor@wiedler.ch>
*/ */
class RoutingServiceProviderTest extends \PHPUnit_Framework_TestCase class RoutingServiceProviderTest extends TestCase
{ {
public function testRegister() public function testRegister()
{ {
......
...@@ -11,6 +11,7 @@ ...@@ -11,6 +11,7 @@
namespace Silex\Tests\Provider; namespace Silex\Tests\Provider;
use PHPUnit\Framework\TestCase;
use Silex\Application; use Silex\Application;
use Silex\Provider\SerializerServiceProvider; use Silex\Provider\SerializerServiceProvider;
...@@ -19,7 +20,7 @@ use Silex\Provider\SerializerServiceProvider; ...@@ -19,7 +20,7 @@ use Silex\Provider\SerializerServiceProvider;
* *
* @author Fabien Potencier <fabien@symfony.com> * @author Fabien Potencier <fabien@symfony.com>
*/ */
class SerializerServiceProviderTest extends \PHPUnit_Framework_TestCase class SerializerServiceProviderTest extends TestCase
{ {
public function testRegister() public function testRegister()
{ {
......
...@@ -11,11 +11,12 @@ ...@@ -11,11 +11,12 @@
namespace Silex\Tests\Provider; namespace Silex\Tests\Provider;
use PHPUnit\Framework\TestCase;
use Silex\Application; use Silex\Application;
use Silex\Provider\SwiftmailerServiceProvider; use Silex\Provider\SwiftmailerServiceProvider;
use Symfony\Component\HttpFoundation\Request; use Symfony\Component\HttpFoundation\Request;
class SwiftmailerServiceProviderTest extends \PHPUnit_Framework_TestCase class SwiftmailerServiceProviderTest extends TestCase
{ {
public function testSwiftMailerServiceIsSwiftMailer() public function testSwiftMailerServiceIsSwiftMailer()
{ {
......
...@@ -11,6 +11,7 @@ ...@@ -11,6 +11,7 @@
namespace Silex\Tests\Provider; namespace Silex\Tests\Provider;
use PHPUnit\Framework\TestCase;
use Silex\Application; use Silex\Application;
use Silex\Provider\TranslationServiceProvider; use Silex\Provider\TranslationServiceProvider;
use Silex\Provider\LocaleServiceProvider; use Silex\Provider\LocaleServiceProvider;
...@@ -22,7 +23,7 @@ use Symfony\Component\HttpKernel\HttpKernelInterface; ...@@ -22,7 +23,7 @@ use Symfony\Component\HttpKernel\HttpKernelInterface;
* *
* @author Daniel Tschinder <daniel@tschinder.de> * @author Daniel Tschinder <daniel@tschinder.de>
*/ */
class TranslationServiceProviderTest extends \PHPUnit_Framework_TestCase class TranslationServiceProviderTest extends TestCase
{ {
/** /**
* @return Application * @return Application
......
...@@ -12,6 +12,7 @@ ...@@ -12,6 +12,7 @@
namespace Silex\Tests\Provider; namespace Silex\Tests\Provider;
use Fig\Link\Link; use Fig\Link\Link;
use PHPUnit\Framework\TestCase;
use Silex\Application; use Silex\Application;
use Silex\Provider\CsrfServiceProvider; use Silex\Provider\CsrfServiceProvider;
use Silex\Provider\FormServiceProvider; use Silex\Provider\FormServiceProvider;
...@@ -25,7 +26,7 @@ use Symfony\Component\HttpFoundation\Request; ...@@ -25,7 +26,7 @@ use Symfony\Component\HttpFoundation\Request;
* *
* @author Igor Wiedler <igor@wiedler.ch> * @author Igor Wiedler <igor@wiedler.ch>
*/ */
class TwigServiceProviderTest extends \PHPUnit_Framework_TestCase class TwigServiceProviderTest extends TestCase
{ {
public function testRegisterAndRender() public function testRegisterAndRender()
{ {
......
...@@ -11,6 +11,7 @@ ...@@ -11,6 +11,7 @@
namespace Silex\Tests\Provider; namespace Silex\Tests\Provider;
use PHPUnit\Framework\TestCase;
use Silex\Application; use Silex\Application;
use Silex\Provider\TranslationServiceProvider; use Silex\Provider\TranslationServiceProvider;
use Silex\Provider\ValidatorServiceProvider; use Silex\Provider\ValidatorServiceProvider;
...@@ -27,7 +28,7 @@ use Symfony\Component\Validator\Validator\ValidatorInterface; ...@@ -27,7 +28,7 @@ use Symfony\Component\Validator\Validator\ValidatorInterface;
* *
* Javier Lopez <f12loalf@gmail.com> * Javier Lopez <f12loalf@gmail.com>
*/ */
class ValidatorServiceProviderTest extends \PHPUnit_Framework_TestCase class ValidatorServiceProviderTest extends TestCase
{ {
public function testRegister() public function testRegister()
{ {
......
...@@ -11,6 +11,7 @@ ...@@ -11,6 +11,7 @@
namespace Silex\Tests\Route; namespace Silex\Tests\Route;
use PHPUnit\Framework\TestCase;
use Silex\Application; use Silex\Application;
use Silex\Provider\SecurityServiceProvider; use Silex\Provider\SecurityServiceProvider;
use Symfony\Component\HttpFoundation\Request; use Symfony\Component\HttpFoundation\Request;
...@@ -20,7 +21,7 @@ use Symfony\Component\HttpFoundation\Request; ...@@ -20,7 +21,7 @@ use Symfony\Component\HttpFoundation\Request;
* *
* @author Fabien Potencier <fabien@symfony.com> * @author Fabien Potencier <fabien@symfony.com>
*/ */
class SecurityTraitTest extends \PHPUnit_Framework_TestCase class SecurityTraitTest extends TestCase
{ {
public function testSecureWithNoAuthenticatedUser() public function testSecureWithNoAuthenticatedUser()
{ {
......
...@@ -11,6 +11,7 @@ ...@@ -11,6 +11,7 @@
namespace Silex\Tests; namespace Silex\Tests;
use PHPUnit\Framework\TestCase;
use Silex\Application; use Silex\Application;
use Symfony\Component\HttpFoundation\Request; use Symfony\Component\HttpFoundation\Request;
use Symfony\Component\HttpFoundation\Response; use Symfony\Component\HttpFoundation\Response;
...@@ -21,7 +22,7 @@ use Symfony\Component\HttpFoundation\RedirectResponse; ...@@ -21,7 +22,7 @@ use Symfony\Component\HttpFoundation\RedirectResponse;
* *
* @author Igor Wiedler <igor@wiedler.ch> * @author Igor Wiedler <igor@wiedler.ch>
*/ */
class RouterTest extends \PHPUnit_Framework_TestCase class RouterTest extends TestCase
{ {
public function testMapRouting() public function testMapRouting()
{ {
......
...@@ -11,6 +11,7 @@ ...@@ -11,6 +11,7 @@
namespace Silex\Tests; namespace Silex\Tests;
use PHPUnit\Framework\TestCase;
use Silex\ServiceControllerResolver; use Silex\ServiceControllerResolver;
use Silex\Application; use Silex\Application;
use Symfony\Component\HttpFoundation\Request; use Symfony\Component\HttpFoundation\Request;
...@@ -19,7 +20,7 @@ use Symfony\Component\HttpFoundation\Request; ...@@ -19,7 +20,7 @@ use Symfony\Component\HttpFoundation\Request;
* Unit tests for ServiceControllerResolver, see ServiceControllerResolverRouterTest for some * Unit tests for ServiceControllerResolver, see ServiceControllerResolverRouterTest for some
* integration tests. * integration tests.
*/ */
class ServiceControllerResolverTest extends \PHPUnit_Framework_Testcase class ServiceControllerResolverTest extends Testcase
{ {
private $app; private $app;
private $mockCallbackResolver; private $mockCallbackResolver;
......
...@@ -11,6 +11,7 @@ ...@@ -11,6 +11,7 @@
namespace Silex\Tests; namespace Silex\Tests;
use PHPUnit\Framework\TestCase;
use Silex\Application; use Silex\Application;
use Symfony\Component\HttpFoundation\Request; use Symfony\Component\HttpFoundation\Request;
...@@ -19,7 +20,7 @@ use Symfony\Component\HttpFoundation\Request; ...@@ -19,7 +20,7 @@ use Symfony\Component\HttpFoundation\Request;
* *
* @author Igor Wiedler <igor@wiedler.ch> * @author Igor Wiedler <igor@wiedler.ch>
*/ */
class StreamTest extends \PHPUnit_Framework_TestCase class StreamTest extends TestCase
{ {
public function testStreamReturnsStreamingResponse() public function testStreamReturnsStreamingResponse()
{ {
......
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