Skip to content
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

Symfony 4.0 #4318

Closed
Naktibalda opened this issue Jun 9, 2017 · 15 comments
Closed

Symfony 4.0 #4318

Naktibalda opened this issue Jun 9, 2017 · 15 comments

Comments

@Naktibalda
Copy link
Member

Symfony 4.0 will be released later this year, and it will come with a new set of breaking changes.

We have to review deprecation messages in Symfony 3.3 and prepare for 4.0 releases.

One example of breaking change is #4316

Setting the "doctrine" pre-defined service is deprecated since Symfony 3.3 and won't be supported anymore in Symfony 4.0
Setting the "doctrine.orm.default_entity_manager" pre-defined service is deprecated since Symfony 3.3 and won't be supported anymore in Symfony 4.0

The likely effect is that Doctrine module will no longer be able to integrate with Symfony module.

@Naktibalda
Copy link
Member Author

That change looks the most dangerous.

Others should not affect Codeception.
symfony/console

The "ConsoleEvents::EXCEPTION" event is deprecated since Symfony 3.3 and will be removed in 4.0. Listen to the "ConsoleEvents::ERROR" event instead.

symfony/dependencyinjection

Autowiring services based on the types they implement is deprecated since Symfony 3.3 and won't be supported in version 4.0.

Relying on its factory's return-type to define the class of service "%s" is deprecated since Symfony 3.3 and won't work in 4.0. Set the "class" attribute to "%s" on the service definition instead.

\Symfony\Component\Form\Extension\DependencyInjection\DependencyInjectionExtension

Passing four arguments to the %s::__construct() method is deprecated since Symfony 3.3 and will be disallowed in Symfony 4.0. The new constructor only accepts three arguments.

symfony/process

Not inheriting environment variables is deprecated since Symfony 3.3 and will always happen in 4.0. Set "Process::inheritEnvironmentVariables()" to true instead.

@tacman
Copy link

tacman commented Aug 9, 2017

To avoid the deprecation errors, set this in the suite settings:

error_level: "E_ALL & ~E_STRICT & ~E_DEPRECATED & ~E_USER_DEPRECATED"

@Naktibalda
Copy link
Member Author

Deprecation is not a problem, removal of the feature in 4.0 will be a problem.

@tacman
Copy link

tacman commented Aug 9, 2017 via email

@muzfr7
Copy link

muzfr7 commented Aug 17, 2017

I'm also getting same deprecation notices while running codeception unit tests with doctrine2 module enabled:

Setting the "doctrine" pre-defined service is deprecated since Symfony 3.3 and won't be supported anymore in Symfony 4.0
Setting the "doctrine.orm.default_entity_manager" pre-defined service is deprecated since Symfony 3.3 and won't be supported anymore in Symfony 4.0

@aliechti
Copy link

Is there any progress on updating to symfony 4?

@VolCh
Copy link
Contributor

VolCh commented Nov 10, 2017

I am waiting to merge and(or) tag stecman/symfony-console-completion#79 php-webdriver/php-webdriver#489 sebastianbergmann/phpunit#2822 to continue #4580

@Naktibalda
Copy link
Member Author

@VolCh Could you test persistService and Doctrine integration with Symfony 4.0?

@VolCh
Copy link
Contributor

VolCh commented Nov 28, 2017

@Naktibalda Codeception/symfony-demo#9 it seems that Doctrine integration works as usually in standard Symfony Demo.

I'll try add some other tests at the evening (UTC+03). Do you have another suggestions? Or feel free to add you tests.

@Naktibalda
Copy link
Member Author

@VolCh
Copy link
Contributor

VolCh commented Nov 28, 2017

@Naktibalda
Copy link
Member Author

What version of symfony/dependency-injection have you got installed?

Relevant code in 3.4: https://github.com/symfony/dependency-injection/blob/3.4/Compiler/AutowirePass.php#L295-L305
and master: https://github.com/symfony/dependency-injection/blob/master/Compiler/AutowirePass.php#L243-L245

My suggestions for tests:
a) multiple HTTP requests in one test
b) test if Codeception can see a new record created by earlier request.

@VolCh
Copy link
Contributor

VolCh commented Nov 28, 2017

With symfony/dependency-injection:v4.0.0-RC2 \Codeception\Module\Doctrine2::grabEntityFromRepository() works.

Suite config is:

actor: FunctionalTester
modules:
    enabled:
        - Symfony:
            app_path: 'src'
            environment: 'test'
        - Doctrine2:
            depends: Symfony
            cleanup: true
        - \App\Tests\Helper\Functional

@VolCh
Copy link
Contributor

VolCh commented Nov 29, 2017

Added Codeception/symfony-demo@59373f4

@Naktibalda
Copy link
Member Author

I am a bit surprised that it didn't cause any issues.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

6 participants