Skip to content

Commit 13a25bd

Browse files
committed
Fix incorrect phpunit bootstrap path
1 parent 097b1ac commit 13a25bd

File tree

4 files changed

+11
-56
lines changed

4 files changed

+11
-56
lines changed

Diff for: plugin/phpunit.xml renamed to phpunit.xml

+5-5
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@
1515
-->
1616

1717
<phpunit
18-
bootstrap="tests/bootstrap.php"
18+
bootstrap="./plugin/tests/bootstrap.php"
1919
backupGlobals="false"
2020
colors="true"
2121
convertErrorsToExceptions="true"
@@ -25,15 +25,15 @@
2525

2626
<testsuites>
2727
<testsuite name="Material Design plugin for WordPress">
28-
<directory suffix=".php">./tests/phpunit/</directory>
28+
<directory suffix=".php">./plugin/tests/phpunit/</directory>
2929
</testsuite>
3030
</testsuites>
3131

3232
<filter>
3333
<whitelist processUncoveredFilesFromWhitelist="false">
34-
<directory suffix=".php">./php</directory>
35-
<file>material-design.php</file>
36-
<file>instance.php</file>
34+
<directory suffix=".php">./plugin/php</directory>
35+
<file>./plugin/material-design.php</file>
36+
<file>./plugin/instance.php</file>
3737
</whitelist>
3838
</filter>
3939
</phpunit>

Diff for: plugin/tests/bootstrap.php

+1-1
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,7 @@
3737

3838
// Composer tests directory.
3939
if ( ! is_dir( $_tests_dir . '/includes/' ) ) {
40-
$_tests_dir = $_plugin_root . '/vendor/xwp/wordpress-tests/phpunit';
40+
$_tests_dir = $_plugin_root . '/../vendor/xwp/wordpress-tests/phpunit';
4141
}
4242

4343
if ( ! file_exists( $_tests_dir . '/includes/' ) ) {

Diff for: plugin/tests/phpunit/php/class-test-plugin-base.php

+5-6
Original file line numberDiff line numberDiff line change
@@ -52,7 +52,7 @@ class Test_Plugin_Base extends \WP_UnitTestCase {
5252
public function setUp() {
5353
parent::setUp();
5454
$this->plugin = get_plugin_instance();
55-
$this->basename = basename( dirname( dirname( dirname( dirname( __FILE__ ) ) ) ) );
55+
$this->basename = basename( dirname( dirname( dirname( dirname( dirname( __FILE__ ) ) ) ) ) );
5656
}
5757

5858
/**
@@ -63,10 +63,9 @@ public function setUp() {
6363
public function test_locate_plugin() {
6464
$location = $this->plugin->locate_plugin();
6565

66-
67-
$this->assertEquals( $this->basename, $location['dir_basename'] );
68-
$this->assertEquals( WP_CONTENT_DIR . '/plugins/' . $this->basename, $location['dir_path'] );
69-
$this->assertEquals( content_url( '/plugins/' . $this->basename . '/' ), $location['dir_url'] );
66+
$this->assertEquals( $this->basename, 'material-design' );
67+
$this->assertEquals( WP_CONTENT_DIR . '/plugins/' . $this->basename . '/plugin', $location['dir_path'] );
68+
$this->assertEquals( content_url( '/plugins/' . $this->basename . '/plugin/' ), $location['dir_url'] );
7069
}
7170

7271
/**
@@ -85,7 +84,7 @@ public function test_relative_path() {
8584
* @see Plugin_Base::asset_url()
8685
*/
8786
public function test_asset_url() {
88-
$this->assertContains( '/plugins/' . $this->basename . '/editor.js', $this->plugin->asset_url( 'editor.js' ) );
87+
$this->assertContains( '/plugins/' . $this->basename . '/plugin/editor.js', $this->plugin->asset_url( 'editor.js' ) );
8988
}
9089

9190
/**

Diff for: theme/phpunit.xml

-44
This file was deleted.

0 commit comments

Comments
 (0)