Skip to content

Commit d4b6591

Browse files
MontealegreLuisNaktibalda
authored andcommitted
Support for PHPUnit 6
* Modify version constraints to allow the installation of PHPUnit 6. * Add aliases for PHPUnit 6. * Use an updated implementation of TestListener for PHPUnit 6 * Add an empty implementation for the method addWarning, added to the TestListener interface in PHPUnit6 * Load this implementation only if PHPUnit 6 is being used, otherwise use the current implementation * Add shim for method setExpectedException * For PHPUnit 5 forward the call to the parent class. * For PHPUnit 6 use expectException, expectExceptionMessage, expectExceptionCode. * Add shim file for loggers removed in PHPUnit 6 * Both the JSON and TAP loggers were removed in PHPUnit 6. * Class name for exception is different for PHPUnit 6. * Add missing setExpectedException method. Added method to the following classes * MysqlTest, PostgresTest, MongoDbTest and RedisTest * Fix version constraint for the mock-objects package when using PHPUnit 4.8 * Check PHP version in shim.php. When using PHP 5.6 class_exists returns true for 'PHPUnit\Framework\TestCase'. PHUnit 6 can only be installed on PHP 7, now it's part of the main condition. * Add phpunit5-loggers.php and the PHPUnit listener to Nitpick's ignore list. * Fix class names in WebDriverTest use underscores instead of namespaces for PHPUnit classes. * Replace namespaces with underscores. * Added missing replacements. * Use method setExpectedException instead of the annotations. * testFailedSeeInPopup was using annotations that were conflicting with the exception thrown when a test is skipped. * Add method addWarning to Listener instead of providing 2 different implementations * Remove the path to this file from nitpick.json * Change tests using setExpectedException to inherit Codeception/Test/Unit. * Remove duplicated method from all tests * Use method_exists instead of class_exists * Check if the method expectException is present. * Use if statement instead of the && operator to call the other 2 methods. * Fix versions range for PHPUnit related packages. * Improve the readability of the condition to add the classes alias * Remove extra space in version constraint. * Add deprecation warning when using PHPUnit 6. * Invert if statement to better match the comment description.
1 parent d208734 commit d4b6591

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

tests/unit/Codeception/Module/RedisTest.php

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,8 +2,9 @@
22

33
use Codeception\Lib\ModuleContainer;
44
use Codeception\Module\Redis;
5+
use Codeception\Test\Unit;
56

6-
class RedisTest extends \PHPUnit_Framework_TestCase
7+
class RedisTest extends Unit
78
{
89
/**
910
* @var array

0 commit comments

Comments
 (0)