Skip to content

Conversation

@IrAlfred
Copy link
Member

Related issue #306

@IrAlfred IrAlfred requested a review from kroky October 11, 2025 23:45
@kroky
Copy link
Member

kroky commented Oct 13, 2025

@IrAlfred thanks, it looks good but can you please add some unit/integration tests to cover the new functionality?

@IrAlfred IrAlfred force-pushed the integrate-advanced-search-into-saved-searches branch 2 times, most recently from 77eebbe to abce26c Compare October 14, 2025 13:28
@IrAlfred IrAlfred requested a review from kroky October 14, 2025 13:45
@IrAlfred IrAlfred force-pushed the integrate-advanced-search-into-saved-searches branch from abce26c to afa4d24 Compare October 14, 2025 21:32
public function setUp(): void {
require_once __DIR__.'/../../bootstrap.php';
require_once APP_PATH.'modules/core/modules.php';
require_once APP_PATH.'modules/saved_searches/modules.php';
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

These three lines are inappropriately placed here. They should be part of the test suite bootstrap process.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Currently, bootstrap.php is included directly in the test classes. For now, I've kept it because otherwise we'd have to modify all these classes and each time we'd either run the tests with the --bootstrap=bootstrap.php flag or include it in the phpunit.xml configurations.

What do you suggest for this ?

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hmm, I see. Well, that's a bit weird to include bootstrap over and over again. Bootstrapping processes is meant to be run only once when the test suite starts, it sets up everything and then the tests are executed. setUp class methods are meant to set up the environment for the tests defined in that file and shouldn't do global bootstrapping tasks. I suggest you make sure bootstrap.php is called ones, put it in phpunit.xml, remove run-time require statements and make sure the bootstrap process includes all modules and files, so we don't have to do random require statements here and there.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can we do that in a separate PR as it's some kind of refactoring ?

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We won't merge this before the 2.5 release, so you have time to do it here. If you prefer, refactor in another branch and PR but then it will have conflicts as you will have to start from current master and you will end up having to resolve the conflicts.

@IrAlfred IrAlfred force-pushed the integrate-advanced-search-into-saved-searches branch from afa4d24 to c893f4b Compare October 20, 2025 13:07
@IrAlfred IrAlfred requested a review from kroky October 20, 2025 13:15
@IrAlfred IrAlfred force-pushed the integrate-advanced-search-into-saved-searches branch from c893f4b to 9d1500b Compare October 20, 2025 13:18
@IrAlfred IrAlfred marked this pull request as draft October 20, 2025 13:24
@IrAlfred IrAlfred force-pushed the integrate-advanced-search-into-saved-searches branch from 9d1500b to 169e1b4 Compare October 20, 2025 14:13
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants