-
-
Notifications
You must be signed in to change notification settings - Fork 6.9k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Codeception 2.3.2 Breaks Yii2 migration #14226
Comments
Are you sure that when trying to migrate database Codeception errors? These two facts should not be related. |
Thanks for posting in our issue tracker.
Thanks! This is an automated comment, triggered by adding the label |
@samdark , I was puzzled as well because I can't make out any dependence between migrate and Codeception. I can only confirm the state of my environment, I rolled back to backup which had 2.3.1 a couple of times and each time tested that migration works on 2.3.1 but fails once you run composer update to take Codeception to 2.3.2. Here's the trace; [01:59 PM]-[vagrant@localhost]-[/var/www/test]
[02:15 PM]-[vagrant@localhost]-[/var/www/test] Fatal error: Cannot declare class Codeception\TestCase\Test, because the name is already in use in /var/www/test/vendor/codeception/base/shim.php on line 58 Call Stack: |
Are you able to reproduce it w/ clean basic project template? |
My project is using the Advanced template so it is impossible to recast it with the basic template. If however you just want us to import the basic template and attempt to reproduce, we need to find a way to make the state of the project similar to what we are trying to reproduce so it will be a comparison of apples and apples. For instance we must take composer to 2.3.1 and run a migration and then take composer to 2.3.2 and run the migration again. If you provide me some guidance to take composer to 2.3.1, I can try |
Should be easy. Open "codeception/base": "2.3.1", or
Then do |
Hello @samdark , I have reproduced the issue successfully on a clean install of the basic template, this is how I tested. ROUND 1
ROUND 2
ROUND 3
ROUND 4
[09:10 AM]-[vagrant@localhost]-[/var/www/basic] Fatal error: Cannot declare class Codeception\TestCase\Test, because the name is already in use in /var/www/basic/vendor/codeception/base/shim.php on line 58 Call Stack: Conclusion |
Additional Note - What happens if we roll back to Codeception 2.3.1 ROUND 5
|
Probably it was caused by Codeception/Codeception#4262 |
this indeed seems like a codeception issue with class loading |
What steps will reproduce the problem?
I'm not sure this issue is systematic or directly dependent on developer code so I can at best present the facts about the state of the environment and what triggered the error
What is the expected result?
The migration should run and make relevant changes to the database schema
What do you get instead?
The following error is thrown (Note that all the code referred to in the error tree is core Yii2 or generated automatically by Composer);
PHP Fatal error: Cannot declare class Codeception\TestCase\Test, because the name is already in use in /var/www/cbt/vendor/codeception/base/shim.php on line 58
PHP Stack trace:
PHP 1. {main}() /var/www/cbt/yii:0
PHP 2. require() /var/www/cbt/yii:14
PHP 3. ComposerAutoloaderInit667629522034f7e7b1cef1939dc2d30f::getLoader() /var/www/cbt/vendor/autoload.php:7
PHP 4. composerRequire667629522034f7e7b1cef1939dc2d30f() /var/www/cbt/vendor/composer/autoload_real.php:56
Fatal error: Cannot declare class Codeception\TestCase\Test, because the name is already in use in /var/www/cbt/vendor/codeception/base/shim.php on line 58
Additional info
The only work around I could find is to roll back to a backup and then set version constraints on composer.json as follows so that codeception is not updated to 2.3.2 when I do composer update;
The text was updated successfully, but these errors were encountered: