Skip to content
This repository was archived by the owner on Jun 30, 2023. It is now read-only.
This repository was archived by the owner on Jun 30, 2023. It is now read-only.

TYPO3 constants redefined with @runInSeparateProcess #52

@mbrodala

Description

@mbrodala

Running a unit test with @runInSeparateProcess fails with an error:

PHPUnit 5.7.25 by Sebastian Bergmann and contributors.

E                                                                   1 / 1 (100%)

Time: 203 ms, Memory: 8.00MB

There was 1 error:

1) Vendor\Package\Tests\Unit\MyTestCase::myTest
PHPUnit_Framework_Exception: PHP Fatal error:  Uncaught RuntimeException: TYPO3_REQUESTTYPE has already been set, cannot be called multiple times in /.../vendor/typo3/cms/typo3/sysext/core/Classes/Core/Bootstrap.php:714
Stack trace:
#0 /.../vendor/nimut/testing-framework/src/TestingFramework/Bootstrap/Bootstrap.php(46): TYPO3\CMS\Core\Core\Bootstrap->setRequestType(6)
#1 /.../vendor/nimut/testing-framework/src/TestingFramework/Bootstrap/AbstractBootstrap.php(76): Nimut\TestingFramework\Bootstrap\Bootstrap->includeAndStartCoreBootstrap()
#2 /.../vendor/nimut/testing-framework/res/Configuration/UnitTestsBootstrap.php(35): Nimut\TestingFramework\Bootstrap\AbstractBootstrap->bootstrapUnitTestSystem()
#3 /.../vendor/nimut/testing-framework/res/Configuration/UnitTestsBootstrap.php(36): {closure}()
#4 -(463): require_once('/var/www/web/ty...')
#5 {main}
  thrown in /.../vendor/typo3/cms/typo3/sysext/core/Classes/Core/Bootstrap.php on line 714

/.../vendor/phpunit/phpunit/phpunit:52

ERRORS!
Tests: 1, Assertions: 0, Errors: 1.

Any idea how to fix this?

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions