Skip to content

Commit

Permalink
[BUGFIX] Drop TYPO3 custom error handler in ac bootstrap (#236)
Browse files Browse the repository at this point in the history
codeception needs to bootstrap up until a point where
DB schema migrator can be executed. This automatically
registers the typo3 error handler, which is active when
the test runner executes suites.
This can lead to happy little side effects. Unregister
our custom error handler after DB schema has been created
for system under test.
  • Loading branch information
lolli42 committed Jun 12, 2021
1 parent d65457b commit 554fabc
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions Classes/Core/Acceptance/Extension/BackendEnvironment.php
Original file line number Diff line number Diff line change
Expand Up @@ -280,6 +280,12 @@ public function bootstrapTypo3Environment(SuiteEvent $suiteEvent)
$testbase->loadExtensionTables();
$testbase->createDatabaseStructure();

// Unregister core error handler again, which has been initialized by
// $testbase->setUpBasicTypo3Bootstrap($instancePath); for DB schema
// migration.
// @todo: See which other possible state should be dropped here again (singletons, ...?)
restore_error_handler();

// Unset a closure or phpunit kicks in with a 'serialization of \Closure is not allowed'
// Alternative solution:
// unset($GLOBALS['TYPO3_CONF_VARS']['SC_OPTIONS']['GLOBAL']['cliKeys']['extbase']);
Expand Down

0 comments on commit 554fabc

Please sign in to comment.