Closed silwerclaw closed 7 years ago
I think that to fix this specific issue it should be enough to add class_exists condition for Assert to https://github.com/Codeception/Codeception/blob/2.3/shim.php#L17
codeception/base
is regularly updated from codeception/codeception
.
I would better add class_exists()
for each entry of class_alias()
to prevent such situations in future in codeception/codeception
Because of latest commit Fix ClassNotFound for PHPUnit > v6 with included in composer dependency codeception/base v.2.3 I get following warning:
Warning: Cannot declare class PHPUnit_Framework_Assert, because the name is already in use in ../vendor/codeception/base/shim.php on line 17
That happens, because file
vendor/codeception/base/shim.php
checks only for absence of classPHPUnit_Framework_TestCase
, creating ALL of related class aliases for phpunit v.6Not sure what solutions there can be applied: change check in codeception/base
shim.php
to look for each class separately, or to make this condition more advanced.