Skip to content

Commit bcb5d58

Browse files
committed
Fix tests in windows environments
1 parent 2835174 commit bcb5d58

2 files changed

Lines changed: 5 additions & 4 deletions

File tree

tests/phpunit/list-table_Tests.php

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -48,18 +48,19 @@ public function test_list_table() {
4848
'lastone/lastone.php'
4949
]
5050
] );
51+
$base = WPMU_PLUGIN_DIR . DIRECTORY_SEPARATOR;
5152
WP_Mock::wpFunction( 'get_plugin_data', [
52-
'args' => ['/root/random/random.php', false ],
53+
'args' => [$base . 'random/random.php', false ],
5354
'return' => [
5455
'Name' => 'Random MU Plugin'
5556
]
5657
] );
5758
WP_Mock::wpFunction( 'get_plugin_data', [
58-
'args' => ['/root/testing/notsame.php', false],
59+
'args' => [$base . 'testing/notsame.php', false],
5960
'return' => []
6061
] );
6162
WP_Mock::wpFunction( 'get_plugin_data', [
62-
'args' => ['/root/lastone/lastone.php', false],
63+
'args' => [$base . 'lastone/lastone.php', false],
6364
'return' => [
6465
'Name' => 'The Last One',
6566
'arbitrary' => [ 1, 2, 3 ],

tests/phpunit/loader_Tests.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -109,7 +109,7 @@ public function test_get_muplugins_nocache() {
109109
// only plugins in directorys should pass: rootplugin.php will go away.
110110
// WP will include root plugins in it's normal course.
111111
WP_Mock::wpFunction( 'get_plugins', [
112-
'args' => [ '/relpath' ],
112+
'args' => [ DIRECTORY_SEPARATOR . 'relpath' ],
113113
'return' => [
114114
'random/plugin1.php' => true,
115115
'random/plugin2.php' => true,

0 commit comments

Comments
 (0)