Skip to content

Commit af4abfe

Browse files
Tests: Assert literal URLs in WP_Site_Health::get_test_plugin_version() tests.
1 parent 99c0d77 commit af4abfe

1 file changed

Lines changed: 4 additions & 4 deletions

File tree

‎tests/phpunit/tests/admin/wpSiteHealthGetTestPluginVersion.php‎

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -88,7 +88,7 @@ public function test_should_report_active_plugins_up_to_date( $count, $sentence
8888
'color' => 'blue',
8989
),
9090
'description' => '<p>Plugins extend your site&#8217;s functionality with things like contact forms, ecommerce and much more. That means they have deep access to your site, so it&#8217;s vital to keep them up to date.</p><p>' . $sentence . '</p>',
91-
'actions' => '<p><a href="' . admin_url( 'plugins.php' ) . '">Manage your plugins</a></p>',
91+
'actions' => '<p><a href="http://' . WP_TESTS_DOMAIN . '/wp-admin/plugins.php">Manage your plugins</a></p>',
9292
'test' => 'plugin_version',
9393
),
9494
$this->get_result()
@@ -126,8 +126,8 @@ public function test_should_report_outdated_plugins( $outdated, $sentence ) {
126126
$this->assertSame( 'You have plugins waiting to be updated', $result['label'], 'The label should match.' );
127127
$this->assertStringEndsWith( '</p><p>' . $sentence . '</p>', $result['description'], 'The description should count the outdated plugins.' );
128128
$this->assertSame(
129-
'<p><a href="' . admin_url( 'plugins.php' ) . '">Manage your plugins</a></p>'
130-
. '<p><a href="' . esc_url( network_admin_url( 'plugins.php?plugin_status=upgrade' ) ) . '">Update your plugins</a></p>',
129+
'<p><a href="http://' . WP_TESTS_DOMAIN . '/wp-admin/plugins.php">Manage your plugins</a></p>'
130+
. '<p><a href="http://' . WP_TESTS_DOMAIN . '/wp-admin/' . ( is_multisite() ? 'network/' : '' ) . 'plugins.php?plugin_status=upgrade">Update your plugins</a></p>',
131131
$result['actions'],
132132
'The actions should link to the plugin updates.'
133133
);
@@ -189,7 +189,7 @@ public function test_should_recommend_removing_inactive_plugins( $total, $active
189189
'The description should count the inactive plugins.'
190190
);
191191
$this->assertStringEndsWith(
192-
'<p><a href="' . esc_url( admin_url( 'plugins.php?plugin_status=inactive' ) ) . '">Manage inactive plugins</a></p>',
192+
'<p><a href="http://' . WP_TESTS_DOMAIN . '/wp-admin/plugins.php?plugin_status=inactive">Manage inactive plugins</a></p>',
193193
$result['actions'],
194194
'The actions should link to the inactive plugins.'
195195
);

0 commit comments

Comments
 (0)