Skip to content

Commit

Permalink
Don't use array deconstruct to feed the unit test
Browse files Browse the repository at this point in the history
  • Loading branch information
thijsoo committed Jul 25, 2024
1 parent 317e54e commit f317254
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 10 deletions.
2 changes: 1 addition & 1 deletion src/integrations/admin/background-indexing-integration.php
Original file line number Diff line number Diff line change
Expand Up @@ -86,7 +86,7 @@ public function __construct(
Yoast_Admin_And_Dashboard_Conditional $yoast_admin_and_dashboard_conditional,
Get_Request_Conditional $get_request_conditional,
WP_CRON_Enabled_Conditional $wp_cron_enabled_conditional,
Indexation_Action_Interface ...$indexing_actions,
Indexation_Action_Interface ...$indexing_actions
) {
$this->indexing_actions = $indexing_actions;
$this->complete_indexation_action = $complete_indexation_action;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -142,14 +142,6 @@ protected function set_up() {
$this->get_request_conditional = Mockery::mock( Get_Request_Conditional::class );
$this->wp_cron_enabled_conditional = Mockery::mock( WP_CRON_Enabled_Conditional::class );

$indexation_actions = [
$this->post_indexation,
$this->term_indexation,
$this->post_type_archive_indexation,
$this->general_indexation,
$this->post_link_indexing_action,
$this->term_link_indexing_action,
];
// This is a partial mock, so we can get test the registering of the shutdown hook.
$this->instance = Mockery::mock(
Background_Indexing_Integration::class,
Expand All @@ -160,7 +152,12 @@ protected function set_up() {
$this->yoast_admin_and_dashboard_conditional,
$this->get_request_conditional,
$this->wp_cron_enabled_conditional,
...$indexation_actions,
$this->post_indexation,
$this->term_indexation,
$this->post_type_archive_indexation,
$this->general_indexation,
$this->post_link_indexing_action,
$this->term_link_indexing_action,
]
)->makePartial()->shouldAllowMockingProtectedMethods();

Expand Down

0 comments on commit f317254

Please sign in to comment.