Skip to content

Commit 9d0a755

Browse files
committed
Tests: Move the wp_mkdir_p() tests to the current folder layout.
Move the tests added in [65175] to `tests/phpunit/tests/functions/`, without a namespace, to match the guidance for new tests during 7.2 on #65208. Rename the race test's stream wrapper class to match. Follow-up to [65175]. See #57081, #65208. git-svn-id: https://develop.svn.wordpress.org/trunk@65329 602fd350-edb4-49c9-b593-d223f7449a82
1 parent a1004b2 commit 9d0a755

1 file changed

Lines changed: 6 additions & 10 deletions

File tree

tests/phpunit/tests/wp-includes/functions/WpMkdirPTest.php renamed to tests/phpunit/tests/functions/WpMkdirP_Test.php

Lines changed: 6 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1,17 +1,13 @@
11
<?php
22

3-
namespace WordPress\Tests\WP_Includes\Functions;
4-
5-
use WP_UnitTestCase;
6-
73
/**
84
* Tests for the `wp_mkdir_p()` function.
95
*
106
* @group functions
117
*
128
* @covers ::wp_mkdir_p
139
*/
14-
class WpMkdirPTest extends WP_UnitTestCase {
10+
class Tests_Functions_WpMkdirP_Test extends WP_UnitTestCase {
1511

1612
/**
1713
* Temporary directories created during testing.
@@ -103,8 +99,8 @@ public function test_permissions_are_set() {
10399
* @ticket 57081
104100
*/
105101
public function test_directory_created_by_another_process_keeps_its_permissions() {
106-
stream_wrapper_register( 'wpmkdirprace', WpMkdirPRaceStream::class );
107-
WpMkdirPRaceStream::reset();
102+
stream_wrapper_register( 'wpmkdirprace', Tests_Functions_WpMkdirP_Race_Stream::class );
103+
Tests_Functions_WpMkdirP_Race_Stream::reset();
108104

109105
// A umask that alters the inherited bits, so the permission block is reached.
110106
$previous_umask = umask( 0022 );
@@ -116,9 +112,9 @@ public function test_directory_created_by_another_process_keeps_its_permissions(
116112
stream_wrapper_unregister( 'wpmkdirprace' );
117113
}
118114

119-
$this->assertSame( 1, WpMkdirPRaceStream::$mkdir_calls, 'The race path was not exercised, so the rest of this test proves nothing.' );
115+
$this->assertSame( 1, Tests_Functions_WpMkdirP_Race_Stream::$mkdir_calls, 'The race path was not exercised, so the rest of this test proves nothing.' );
120116
$this->assertTrue( $created, 'Losing the race is not a failure: the directory exists.' );
121-
$this->assertSame( 0, WpMkdirPRaceStream::$chmod_calls, 'wp_mkdir_p() must not change permissions on a directory it did not create.' );
117+
$this->assertSame( 0, Tests_Functions_WpMkdirP_Race_Stream::$chmod_calls, 'wp_mkdir_p() must not change permissions on a directory it did not create.' );
122118
}
123119
}
124120

@@ -129,7 +125,7 @@ public function test_directory_created_by_another_process_keeps_its_permissions(
129125
* is the state wp_mkdir_p() sees when another process created the directory first.
130126
* Permission changes are counted rather than applied.
131127
*/
132-
class WpMkdirPRaceStream {
128+
class Tests_Functions_WpMkdirP_Race_Stream {
133129

134130
/**
135131
* Number of permission changes attempted through this wrapper.

0 commit comments

Comments
 (0)