Browse Source

Compatibility with PHPUnit 6.x adjusted

tags/2.0.7
Klimov Paul 8 years ago
parent
commit
7bc0079b26
  1. 2
      tests/TestCase.php
  2. 14
      tests/compatibility.php

2
tests/TestCase.php

@ -4,7 +4,7 @@ namespace yiiunit\extensions\swiftmailer;
use yii\helpers\ArrayHelper; use yii\helpers\ArrayHelper;
abstract class TestCase extends \PHPUnit_Framework_TestCase abstract class TestCase extends \PHPUnit\Framework\TestCase
{ {
/** /**
* Clean up after test. * Clean up after test.

14
tests/compatibility.php

@ -1,12 +1,16 @@
<?php <?php
/* /*
* Ensures compatibility with PHPUnit 6.x * Ensures compatibility with PHPUnit < 6.x
*/ */
if (!class_exists('PHPUnit_Framework_Constraint') && class_exists('PHPUnit\Framework\Constraint\Constraint')) { if (!class_exists('PHPUnit\Framework\Constraint\Constraint') && class_exists('PHPUnit_Framework_Constraint')) {
abstract class PHPUnit_Framework_Constraint extends \PHPUnit\Framework\Constraint\Constraint {} namespace PHPUnit\Framework\Constraint {
abstract class Constraint extends \PHPUnit_Framework_Constraint {}
}
} }
if (!class_exists('PHPUnit_Framework_TestCase') && class_exists('PHPUnit\Framework\TestCase')) { if (!class_exists('PHPUnit\Framework\TestCase') && class_exists('PHPUnit_Framework_TestCase')) {
abstract class PHPUnit_Framework_TestCase extends \PHPUnit\Framework\TestCase {} namespace PHPUnit\Framework {
abstract class TestCase extends \PHPUnit_Framework_TestCase {}
}
} }

Loading…
Cancel
Save