-
Notifications
You must be signed in to change notification settings - Fork 10
/
test_wordpress_plugin_tests.php
52 lines (38 loc) 路 1.24 KB
/
test_wordpress_plugin_tests.php
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
<?php
/**
* Tests to test that that testing framework is testing tests. Meta, huh?
*
* @package wordpress-plugins-tests
*/
class WP_Test_WordPress_Plugin_Tests extends WP_UnitTestCase {
/**
* Run a simple test to ensure that the tests are running
*/
function test_tests() {
$this->assertTrue( true );
}
/**
* If these tests are being run on Travis CI, verify that the version of
* WordPress installed is the version that we requested.
*
* @requires PHP 5.3
*/
function test_wp_version() {
if ( !getenv( 'TRAVIS' ) )
$this->markTestSkipped( 'Test skipped since Travis CI was not detected.' );
$requested_version = getenv( 'WP_VERSION' ) . '-src';
// The "master" version requires special handling.
if ( $requested_version == 'master-src' ) {
$file = file_get_contents( 'https://develop.svn.wordpress.org/trunk/src/wp-includes/version.php' );
preg_match( '#\$wp_version = \'([^\']+)\';#', $file, $matches );
$requested_version = $matches[1];
}
$this->assertEquals( get_bloginfo( 'version' ), $requested_version );
}
/**
* Ensure that the plugin has been installed and activated.
*/
function test_plugin_activated() {
$this->assertTrue( is_plugin_active( 'cf7-customizer/cf7-customizer.php' ) );
}
}