Skip to content

Commit

Permalink
Update test simple share button adder + update phpunit bootstrap
Browse files Browse the repository at this point in the history
  • Loading branch information
aytackokus committed Mar 18, 2022
1 parent 8060126 commit 5380a5a
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 8 deletions.
9 changes: 2 additions & 7 deletions tests/bootstrap.php
Original file line number Diff line number Diff line change
Expand Up @@ -32,14 +32,9 @@
// Give access to tests_add_filter() function.
require_once "{$cybot_cookiebot_tests_dir}/includes/functions.php";

/**
* Manually load the plugin being tested.
*/
function cybot_cookiebot_manually_load_plugin() {
tests_add_filter( 'muplugins_loaded', function() {
require dirname( dirname( __FILE__ ) ) . '/cookiebot.php';
}

tests_add_filter( 'muplugins_loaded', 'cybot_cookiebot_manually_load_plugin' );
} );

// Start up the WP testing environment.
require "{$cybot_cookiebot_tests_dir}/includes/bootstrap.php";
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,6 @@ class Test_Simple_Share_Buttons_Adder extends WP_UnitTestCase {
public function test_is_plugin_compatible() {
$content = Simple_Share_Buttons_Adder::get_svn_file_content( 'php/class-styles.php' );

$this->assertNotFalse( strpos( $content, "wp_enqueue_script('ssba-sharethis'" ) );
$this->assertNotFalse( strpos( $content, "wp_enqueue_script( 'ssba-sharethis'" ) );
}
}

0 comments on commit 5380a5a

Please sign in to comment.