Skip to content

Commit

Permalink
Update tests for enqueued resources check
Browse files Browse the repository at this point in the history
  • Loading branch information
ernilambar committed Dec 25, 2023
1 parent df3d289 commit 18a323e
Show file tree
Hide file tree
Showing 3 changed files with 15 additions and 6 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -18,8 +18,3 @@
?>
<link rel="stylesheet" href="http://someurl/somefile.css">
<script src="http://someurl/somefile.js"></script>

<?php

?><link rel="stylesheet" href="https://someurl/somefile.css"><?php
?><script src="https://someurl/somefile.js"></script><?php
Original file line number Diff line number Diff line change
Expand Up @@ -14,3 +14,17 @@
*
* @package test-plugin-enqueued-resources-without-errors
*/

add_action(
'wp_enqueue_scripts',
function() {
wp_enqueue_script(
'plugin_check_script',
'http://someurl/somefile.js'
);
wp_enqueue_style(
'plugin_check_style',
'http://someurl/somefile.css'
);
}
);
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ public function test_run_with_errors() {

$this->assertNotEmpty( $errors );
$this->assertArrayHasKey( 'load.php', $errors );
$this->assertEquals( 4, $check_result->get_error_count() );
$this->assertEquals( 2, $check_result->get_error_count() );
}

public function test_run_without_errors() {
Expand Down

0 comments on commit 18a323e

Please sign in to comment.