Browse Source

Fixed compatibility with PHPUnit 6.x

tags/2.0.7
Klimov Paul 8 years ago
parent
commit
b3482dac65
  1. 2
      tests/bootstrap.php
  2. 12
      tests/compatibility.php

2
tests/bootstrap.php

@ -13,3 +13,5 @@ require_once(__DIR__ . '/../vendor/yiisoft/yii2/Yii.php');
Yii::setAlias('@yiiunit/extensions/swiftmailer', __DIR__);
Yii::setAlias('@yii/swiftmailer', dirname(__DIR__));
require_once(__DIR__ . '/compatibility.php');

12
tests/compatibility.php

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