feat(wpmc 1.1.0): Redirect hook moves to template_redirect@1
Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
This commit is contained in:
@@ -34,9 +34,9 @@ final class PluginBootS4Test extends TestCase
|
||||
'boot() must register Router on wp@9999'
|
||||
);
|
||||
self::assertSame(
|
||||
9998,
|
||||
has_action('wp', ['WPMultiCity\\Redirect', 'handle']),
|
||||
'boot() must register Redirect on wp@9998'
|
||||
1,
|
||||
has_action('template_redirect', ['WPMultiCity\\Redirect', 'handle']),
|
||||
'boot() must register Redirect on template_redirect@1'
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -74,8 +74,8 @@ final class PluginBootTest extends TestCase
|
||||
\Brain\Monkey\Actions\expectAdded('acf/init')
|
||||
->with([\WPMultiCity\TermMeta::class, 'do_register'])
|
||||
->once();
|
||||
\Brain\Monkey\Actions\expectAdded('wp')
|
||||
->with([\WPMultiCity\Redirect::class, 'handle'], 9998)
|
||||
\Brain\Monkey\Actions\expectAdded('template_redirect')
|
||||
->with([\WPMultiCity\Redirect::class, 'handle'], 1)
|
||||
->once();
|
||||
\Brain\Monkey\Actions\expectAdded('wp')
|
||||
->with([\WPMultiCity\Router::class, 'route'], 9999)
|
||||
|
||||
@@ -7,14 +7,14 @@ use WPMultiCity\Redirect;
|
||||
|
||||
final class RedirectTest extends TestCase
|
||||
{
|
||||
public function test_register_attaches_wp_action_at_priority_9998(): void
|
||||
public function test_register_attaches_template_redirect_at_priority_1(): void
|
||||
{
|
||||
Redirect::register();
|
||||
|
||||
self::assertSame(
|
||||
9998,
|
||||
has_action('wp', [Redirect::class, 'handle']),
|
||||
'Redirect::register() must hook wp action at priority 9998'
|
||||
1,
|
||||
has_action('template_redirect', [Redirect::class, 'handle']),
|
||||
'Redirect::register() must hook template_redirect at priority 1'
|
||||
);
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user