-
Notifications
You must be signed in to change notification settings - Fork 20
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
5 changed files
with
89 additions
and
11 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,4 @@ | ||
<?xml version="1.0"?> | ||
<phpunit | ||
bootstrap="tests/bootstrap.php" | ||
backupGlobals="false" | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,31 @@ | ||
<?php | ||
/** | ||
* PHPUnit bootstrap file | ||
* | ||
* @package Snow_Monkey_Awesome_Custom_Blocks | ||
*/ | ||
|
||
$_tests_dir = getenv( 'WP_TESTS_DIR' ); | ||
|
||
if ( ! $_tests_dir ) { | ||
$_tests_dir = rtrim( sys_get_temp_dir(), '/\\' ) . '/wordpress-tests-lib'; | ||
} | ||
|
||
if ( ! file_exists( $_tests_dir . '/includes/functions.php' ) ) { | ||
echo "Could not find $_tests_dir/includes/functions.php, have you run bin/install-wp-tests.sh ?" . PHP_EOL; | ||
exit( 1 ); | ||
} | ||
|
||
// Give access to tests_add_filter() function. | ||
require_once $_tests_dir . '/includes/functions.php'; | ||
|
||
/** | ||
* Manually load the plugin being tested. | ||
*/ | ||
function _manually_load_plugin() { | ||
require dirname( dirname( __FILE__ ) ) . '/snow-monkey-awesome-custom-blocks.php'; | ||
} | ||
tests_add_filter( 'muplugins_loaded', '_manually_load_plugin' ); | ||
|
||
// Start up the WP testing environment. | ||
require $_tests_dir . '/includes/bootstrap.php'; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,20 @@ | ||
<?php | ||
/** | ||
* Class SampleTest | ||
* | ||
* @package Snow_Monkey_Awesome_Custom_Blocks | ||
*/ | ||
|
||
/** | ||
* Sample test case. | ||
*/ | ||
class SampleTest extends WP_UnitTestCase { | ||
|
||
/** | ||
* A single example test. | ||
*/ | ||
function test_sample() { | ||
// Replace this with some actual testing code. | ||
$this->assertTrue( true ); | ||
} | ||
} |