Skip to content

Commit b558678

Browse files
committed
minor #250 Switch to namespaced PHPUnit classes (derrabus)
This PR was merged into the 3.x-dev branch. Discussion ---------- Switch to namespaced PHPUnit classes This PR switches the PHPUnit test base class from PEAR-style `PHPUnit_Framework_TestCase` to the namespaced `PHPUnit\Framework\TestCase`, which enables us to run the tests with PHPUnit 6 as well. Commits ------- cc0e01d Switch to namespaced PHPUnit classes.
2 parents 14fa856 + cc0e01d commit b558678

File tree

7 files changed

+14
-6
lines changed

7 files changed

+14
-6
lines changed

.travis.yml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -30,6 +30,7 @@ matrix:
3030
env: DEPENDENCIES=dev
3131
- php: 7.0
3232
- php: 7.1
33+
- php: 7.2
3334
- php: hhvm
3435
allow_failures:
3536
- env: DEPENDENCIES=dev

Tests/DependencyInjection/Compiler/AddProcessorsPassTest.php

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,14 +11,15 @@
1111

1212
namespace Symfony\Bundle\MonologBundle\Tests\DependencyInjection\Compiler;
1313

14+
use PHPUnit\Framework\TestCase;
1415
use Symfony\Bundle\MonologBundle\DependencyInjection\Compiler\AddProcessorsPass;
1516
use Symfony\Component\DependencyInjection\Reference;
1617
use Symfony\Component\DependencyInjection\Definition;
1718
use Symfony\Component\DependencyInjection\ContainerBuilder;
1819
use Symfony\Component\Config\FileLocator;
1920
use Symfony\Component\DependencyInjection\Loader\XmlFileLoader;
2021

21-
class AddProcessorsPassTest extends \PHPUnit_Framework_TestCase
22+
class AddProcessorsPassTest extends TestCase
2223
{
2324
public function testHandlerProcessors()
2425
{

Tests/DependencyInjection/Compiler/AddSwiftMailerTransportPassTest.php

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,13 +11,14 @@
1111

1212
namespace Symfony\Bundle\MonologBundle\Tests\DependencyInjection\Compiler;
1313

14+
use PHPUnit\Framework\TestCase;
1415
use Symfony\Bundle\MonologBundle\DependencyInjection\Compiler\AddSwiftMailerTransportPass;
1516
use Symfony\Component\DependencyInjection\Reference;
1617

1718
/**
1819
* @author Christian Flothmann <christian.flothmann@xabbuh.de>
1920
*/
20-
class AddSwiftMailerTransportPassTest extends \PHPUnit_Framework_TestCase
21+
class AddSwiftMailerTransportPassTest extends TestCase
2122
{
2223
private $compilerPass;
2324

Tests/DependencyInjection/Compiler/FixEmptyLoggerPassTest.php

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,10 +11,11 @@
1111

1212
namespace Symfony\Bundle\MonologBundle\Tests\DependencyInjection\Compiler;
1313

14+
use PHPUnit\Framework\TestCase;
1415
use Symfony\Bundle\MonologBundle\DependencyInjection\Compiler\FixEmptyLoggerPass;
1516
use Symfony\Component\DependencyInjection\ContainerBuilder;
1617

17-
class FixEmptyLoggerPassTest extends \PHPUnit_Framework_TestCase
18+
class FixEmptyLoggerPassTest extends TestCase
1819
{
1920
public function testProcess()
2021
{

Tests/DependencyInjection/Compiler/LoggerChannelPassTest.php

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,14 +11,15 @@
1111

1212
namespace Symfony\Bundle\MonologBundle\Tests\DependencyInjection\Compiler;
1313

14+
use PHPUnit\Framework\TestCase;
1415
use Symfony\Component\DependencyInjection\Reference;
1516
use Symfony\Component\DependencyInjection\Definition;
1617
use Symfony\Component\DependencyInjection\ContainerBuilder;
1718
use Symfony\Bundle\MonologBundle\DependencyInjection\Compiler\LoggerChannelPass;
1819
use Symfony\Component\Config\FileLocator;
1920
use Symfony\Component\DependencyInjection\Loader\XmlFileLoader;
2021

21-
class LoggerChannelPassTest extends \PHPUnit_Framework_TestCase
22+
class LoggerChannelPassTest extends TestCase
2223
{
2324
public function testProcess()
2425
{

Tests/DependencyInjection/ConfigurationTest.php

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,11 +12,12 @@
1212
namespace Symfony\Bundle\MonologBundle\Tests\DependencyInjection;
1313

1414
use Monolog\Logger;
15+
use PHPUnit\Framework\TestCase;
1516
use Symfony\Bundle\MonologBundle\DependencyInjection\Configuration;
1617
use Symfony\Component\Config\Definition\Processor;
1718
use Symfony\Component\Console\Output\OutputInterface;
1819

19-
class ConfigurationTest extends \PHPUnit_Framework_TestCase
20+
class ConfigurationTest extends TestCase
2021
{
2122
/**
2223
* Some basic tests to make sure the configuration is correctly processed in

Tests/DependencyInjection/DependencyInjectionTest.php

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,9 @@
1111

1212
namespace Symfony\Bundle\MonologBundle\Tests\DependencyInjection;
1313

14-
abstract class DependencyInjectionTest extends \PHPUnit_Framework_TestCase
14+
use PHPUnit\Framework\TestCase;
15+
16+
abstract class DependencyInjectionTest extends TestCase
1517
{
1618
/**
1719
* Assertion on the Class of a DIC Service Definition.

0 commit comments

Comments
 (0)