@@ -67,7 +67,7 @@ public function setUp()
6767 {
6868 }
6969 /**
70- * After a test method runs, reset any state in WordPress the test method might have changed.
70+ * After a test method runs, resets any state in WordPress the test method might have changed.
7171 */
7272 public function tearDown ()
7373 {
@@ -79,40 +79,40 @@ public function clean_up_global_scope()
7979 {
8080 }
8181 /**
82- * Allow tests to be skipped on some automated runs.
82+ * Allows tests to be skipped on some automated runs.
8383 *
84- * For test runs on Travis/ GitHub Actions for something other than trunk/master,
84+ * For test runs on GitHub Actions for something other than trunk/master,
8585 * we want to skip tests that only need to run for master.
8686 */
8787 public function skipOnAutomatedBranches ()
8888 {
8989 }
9090 /**
91- * Allow tests to be skipped when Multisite is not in use.
91+ * Allows tests to be skipped when Multisite is not in use.
9292 *
9393 * Use in conjunction with the ms-required group.
9494 */
9595 public function skipWithoutMultisite ()
9696 {
9797 }
9898 /**
99- * Allow tests to be skipped when Multisite is in use.
99+ * Allows tests to be skipped when Multisite is in use.
100100 *
101101 * Use in conjunction with the ms-excluded group.
102102 */
103103 public function skipWithMultisite ()
104104 {
105105 }
106106 /**
107- * Allow tests to be skipped if the HTTP request times out.
107+ * Allows tests to be skipped if the HTTP request times out.
108108 *
109109 * @param array|WP_Error $response HTTP response.
110110 */
111111 public function skipTestOnTimeout ($ response )
112112 {
113113 }
114114 /**
115- * Unregister existing post types and register defaults.
115+ * Unregisters existing post types and register defaults.
116116 *
117117 * Run before each test in order to clean up the global scope, in case
118118 * a test forgets to unregister a post type on its own, or fails before
@@ -122,7 +122,7 @@ protected function reset_post_types()
122122 {
123123 }
124124 /**
125- * Unregister existing taxonomies and register defaults.
125+ * Unregisters existing taxonomies and register defaults.
126126 *
127127 * Run before each test in order to clean up the global scope, in case
128128 * a test forgets to unregister a taxonomy on its own, or fails before
@@ -132,13 +132,13 @@ protected function reset_taxonomies()
132132 {
133133 }
134134 /**
135- * Unregister non-built-in post statuses.
135+ * Unregisters non-built-in post statuses.
136136 */
137137 protected function reset_post_statuses ()
138138 {
139139 }
140140 /**
141- * Reset `$_SERVER` variables
141+ * Resets `$_SERVER` variables
142142 */
143143 protected function reset__SERVER ()
144144 {
@@ -174,7 +174,7 @@ public static function flush_cache()
174174 {
175175 }
176176 /**
177- * Clean up any registered meta keys.
177+ * Cleans up any registered meta keys.
178178 *
179179 * @since 5.1.0
180180 *
@@ -190,7 +190,7 @@ public function start_transaction()
190190 {
191191 }
192192 /**
193- * Commit the queries in a transaction.
193+ * Commits the queries in a transaction.
194194 *
195195 * @since 4.1.0
196196 */
@@ -249,7 +249,7 @@ public function expectedDeprecated()
249249 {
250250 }
251251 /**
252- * Detect post-test failure conditions.
252+ * Detects post-test failure conditions.
253253 *
254254 * We use this method to detect expectedDeprecated and expectedIncorrectUsage annotations.
255255 *
@@ -259,7 +259,7 @@ protected function assertPostConditions()
259259 {
260260 }
261261 /**
262- * Declare an expected `_deprecated_function()` or `_deprecated_argument()` call from within a test.
262+ * Declares an expected `_deprecated_function()` or `_deprecated_argument()` call from within a test.
263263 *
264264 * @since 4.2.0
265265 *
@@ -270,7 +270,7 @@ public function setExpectedDeprecated($deprecated)
270270 {
271271 }
272272 /**
273- * Declare an expected `_doing_it_wrong()` call from within a test.
273+ * Declares an expected `_doing_it_wrong()` call from within a test.
274274 *
275275 * @since 4.2.0
276276 *
@@ -364,9 +364,10 @@ public function assertDiscardWhitespace($expected, $actual)
364364 * Asserts that two values have the same type and value, with EOL differences discarded.
365365 *
366366 * @since 5.6.0
367+ * @since 5.8.0 Added support for nested arrays.
367368 *
368- * @param string $expected The expected value.
369- * @param string $actual The actual value.
369+ * @param string|array $expected The expected value.
370+ * @param string|array $actual The actual value.
370371 */
371372 public function assertSameIgnoreEOL ($ expected , $ actual )
372373 {
@@ -614,8 +615,8 @@ public function delete_folders($path)
614615 {
615616 }
616617 /**
617- * Retrieves all directories contained inside a directory and stores them in the `$matched_dirs` property. Hidden
618- * directories are ignored.
618+ * Retrieves all directories contained inside a directory and stores them in the `$matched_dirs` property.
619+ * Hidden directories are ignored.
619620 *
620621 * This is a helper for the `delete_folders()` method.
621622 *
@@ -1014,8 +1015,7 @@ public function get_max_num_pages($object_subtype = '')
10141015 * 'DIRECTORY' to the static variable WP_Test_Stream::$data['bucket']['/foo/']
10151016 * (note the trailing slash).
10161017 *
1017- * This class can be used to test that code works with basic read/write streams,
1018- * as such, operations such as seeking are not supported.
1018+ * This class can be used to test that code works with basic read/write streams.
10191019 *
10201020 * This class does not register itself as a stream handler: test fixtures
10211021 * should make the appropriate call to stream_wrapper_register().
@@ -1027,65 +1027,77 @@ class WP_Test_Stream
10271027 /**
10281028 * In-memory storage for files and directories simulated by this wrapper.
10291029 */
1030- static $ data = array ();
1031- var $ position ;
1032- var $ file ;
1033- var $ bucket ;
1034- var $ data_ref ;
1030+ public static $ data = array ();
1031+ public $ position ;
1032+ public $ file ;
1033+ public $ bucket ;
1034+ public $ data_ref ;
10351035 /**
10361036 * Opens a URL.
10371037 *
10381038 * @see streamWrapper::stream_open
10391039 */
1040- function stream_open ($ path , $ mode , $ options , &$ opened_path )
1040+ public function stream_open ($ path , $ mode , $ options , &$ opened_path )
10411041 {
10421042 }
10431043 /**
10441044 * Reads from a stream.
10451045 *
10461046 * @see streamWrapper::stream_read
10471047 */
1048- function stream_read ($ count )
1048+ public function stream_read ($ count )
10491049 {
10501050 }
10511051 /**
10521052 * Writes to a stream.
10531053 *
10541054 * @see streamWrapper::stream_write
10551055 */
1056- function stream_write ($ data )
1056+ public function stream_write ($ data )
1057+ {
1058+ }
1059+ /**
1060+ * Seeks to specific location in a stream.
1061+ *
1062+ * @see streamWrapper::stream_seek
1063+ *
1064+ * @param int $offset The stream offset to seek to.
1065+ * @param int $whence Optional. Seek position.
1066+ * @return bool Returns true when position is updated, else false.
1067+ */
1068+ public function stream_seek ($ offset , $ whence = \SEEK_SET )
10571069 {
10581070 }
10591071 /**
10601072 * Retrieves the current position of a stream.
10611073 *
10621074 * @see streamWrapper::stream_tell
10631075 */
1064- function stream_tell ()
1076+ public function stream_tell ()
10651077 {
10661078 }
10671079 /**
10681080 * Tests for end-of-file.
10691081 *
10701082 * @see streamWrapper::stream_eof
10711083 */
1072- function stream_eof ()
1084+ public function stream_eof ()
10731085 {
10741086 }
10751087 /**
10761088 * Change stream metadata.
10771089 *
10781090 * @see streamWrapper::stream_metadata
10791091 */
1080- function stream_metadata ($ path , $ option , $ var )
1092+ public function stream_metadata ($ path , $ option , $ var )
10811093 {
10821094 }
10831095 /**
10841096 * Creates a directory.
10851097 *
10861098 * @see streamWrapper::mkdir
10871099 */
1088- function mkdir ($ path , $ mode , $ options )
1100+ public function mkdir ($ path , $ mode , $ options )
10891101 {
10901102 }
10911103 /**
@@ -3466,12 +3478,6 @@ protected function _handleAjax($action)
34663478 */
34673479 class Block_Supported_Styles_Test extends \WP_UnitTestCase
34683480 {
3469- /**
3470- * Sets up each test method.
3471- */
3472- public function setUp ()
3473- {
3474- }
34753481 /**
34763482 * Tear down each test method.
34773483 */
0 commit comments