Refactor tests to extend AbstractTestCase from Modules/Core/Tests#291
Conversation
|
Important Review skippedBot user detected. To trigger a single review, invoke the You can disable this status message by setting the Comment |
Co-authored-by: nielsdrost7 <47660417+nielsdrost7@users.noreply.github.com>
|
Just as a heads up, I was blocked by some firewall rules while working on your feedback. Expand below for details. Warning Firewall rules blocked me from connecting to one or more addresses (expand for details)I tried to connect to the following addresses, but was blocked by firewall rules:
If you need me to access, download, or install something from one of these locations, you can either:
|
nielsdrost7
left a comment
There was a problem hiding this comment.
@copilot not a single file should extend Tests\TestCase, they all should extend a similar file in Modules/Core/Tests it's either the AbstractAdminPanelTestCase or AbstractCompanyPanelTestCase or similar files, but not files in the "tests" directory in the root of the project.
Refactor away from using Tests\TestCase and Update Junie and copilot guidelines to reflect this rule
Co-authored-by: nielsdrost7 <47660417+nielsdrost7@users.noreply.github.com>
Done in commit d8e4ce7. Changes made:
|
PHPUnit tests were failing with
Class "Tests\TestCase" not founderror. Multiple test files were incorrectly extendingTests\TestCasefrom the root namespace, but InvoicePlane v2's modular architecture requires all tests to extend abstract test cases fromModules/Core/Tests/.Changes
Modules\Core\Tests\AbstractTestCaseinstead ofTests\TestCase.github/copilot-instructions.mdwith testing rule.junie/guidelines.mdwith testing ruleTest files updated:
Modules/Core/Tests/Unit/NumberGenerator/NumberGeneratorTemplateTest.phpModules/Core/Tests/Feature/NumberingPanelAccessTest.phpModules/Core/Tests/Unit/Services/NumberingCompanyIsolationTest.phpModules/Invoices/Tests/Feature/InvoiceNumberingSchemeChangeTest.phpModules/Invoices/Tests/Feature/InvoiceDuplicateNumberPreventionTest.phpModules/Quotes/Tests/Feature/QuoteDuplicateNumberPreventionTest.phpNew guideline added:
Tests\TestCase- all tests must extend one of the abstract test cases fromModules/Core/Tests/:AbstractTestCase- Basic test case with application bootstrapAbstractAdminPanelTestCase- For admin panel tests with RefreshDatabaseAbstractCompanyPanelTestCase- For company panel tests with multi-tenancy✨ Let Copilot coding agent set things up for you — coding agent works faster and does higher quality work when set up for your repo.