Skip to content

Conversation

@jaxwilko
Copy link
Member

@jaxwilko jaxwilko commented Mar 8, 2023

We register backwards compatible aliases for test cases, however the aliases are not registered in the test bootstrapping.

// modules/system/aliases.php
'TestCase'       => System\Tests\Bootstrap\TestCase::class,
'PluginTestCase' => System\Tests\Bootstrap\PluginTestCase::class,

This PR registers the aliases ahead of time allowing tests to use:

class MyTestCase extends \TestCase

Which will allow for the same test cases to work in both v1.1.9 & >v1.2.0

@jaxwilko jaxwilko requested a review from LukeTowers March 8, 2023 11:11
@what-the-diff
Copy link

what-the-diff bot commented Mar 8, 2023

  • The aliases.php file is included in the bootstrap/app.php
  • All classes are registered as an alias for autoloading

@LukeTowers LukeTowers added Status: Completed maintenance PRs that fix bugs, are translation changes or make only minor changes labels Mar 8, 2023
@LukeTowers LukeTowers added this to the v1.2.2 milestone Mar 8, 2023
@LukeTowers LukeTowers merged commit dde07a0 into develop Mar 8, 2023
@LukeTowers LukeTowers deleted the wip/system-aliases-in-tests branch March 8, 2023 15:54
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

maintenance PRs that fix bugs, are translation changes or make only minor changes

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants