Skip to content

Commit

Permalink
Generate stubs for WordPress Tests 5.8.7
Browse files Browse the repository at this point in the history
  • Loading branch information
swissspidy committed Aug 10, 2023
1 parent e0f1c83 commit b044a74
Show file tree
Hide file tree
Showing 2 changed files with 46 additions and 40 deletions.
2 changes: 1 addition & 1 deletion VERSION
Original file line number Diff line number Diff line change
@@ -1 +1 @@
5.7.9
5.8.7
84 changes: 45 additions & 39 deletions wordpress-tests-stubs.php
Original file line number Diff line number Diff line change
Expand Up @@ -67,7 +67,7 @@ public function setUp()
{
}
/**
* After a test method runs, reset any state in WordPress the test method might have changed.
* After a test method runs, resets any state in WordPress the test method might have changed.
*/
public function tearDown()
{
Expand All @@ -79,40 +79,40 @@ public function clean_up_global_scope()
{
}
/**
* Allow tests to be skipped on some automated runs.
* Allows tests to be skipped on some automated runs.
*
* For test runs on Travis/GitHub Actions for something other than trunk/master,
* For test runs on GitHub Actions for something other than trunk/master,
* we want to skip tests that only need to run for master.
*/
public function skipOnAutomatedBranches()
{
}
/**
* Allow tests to be skipped when Multisite is not in use.
* Allows tests to be skipped when Multisite is not in use.
*
* Use in conjunction with the ms-required group.
*/
public function skipWithoutMultisite()
{
}
/**
* Allow tests to be skipped when Multisite is in use.
* Allows tests to be skipped when Multisite is in use.
*
* Use in conjunction with the ms-excluded group.
*/
public function skipWithMultisite()
{
}
/**
* Allow tests to be skipped if the HTTP request times out.
* Allows tests to be skipped if the HTTP request times out.
*
* @param array|WP_Error $response HTTP response.
*/
public function skipTestOnTimeout($response)
{
}
/**
* Unregister existing post types and register defaults.
* Unregisters existing post types and register defaults.
*
* Run before each test in order to clean up the global scope, in case
* a test forgets to unregister a post type on its own, or fails before
Expand All @@ -122,7 +122,7 @@ protected function reset_post_types()
{
}
/**
* Unregister existing taxonomies and register defaults.
* Unregisters existing taxonomies and register defaults.
*
* Run before each test in order to clean up the global scope, in case
* a test forgets to unregister a taxonomy on its own, or fails before
Expand All @@ -132,13 +132,13 @@ protected function reset_taxonomies()
{
}
/**
* Unregister non-built-in post statuses.
* Unregisters non-built-in post statuses.
*/
protected function reset_post_statuses()
{
}
/**
* Reset `$_SERVER` variables
* Resets `$_SERVER` variables
*/
protected function reset__SERVER()
{
Expand Down Expand Up @@ -174,7 +174,7 @@ public static function flush_cache()
{
}
/**
* Clean up any registered meta keys.
* Cleans up any registered meta keys.
*
* @since 5.1.0
*
Expand All @@ -190,7 +190,7 @@ public function start_transaction()
{
}
/**
* Commit the queries in a transaction.
* Commits the queries in a transaction.
*
* @since 4.1.0
*/
Expand Down Expand Up @@ -249,7 +249,7 @@ public function expectedDeprecated()
{
}
/**
* Detect post-test failure conditions.
* Detects post-test failure conditions.
*
* We use this method to detect expectedDeprecated and expectedIncorrectUsage annotations.
*
Expand All @@ -259,7 +259,7 @@ protected function assertPostConditions()
{
}
/**
* Declare an expected `_deprecated_function()` or `_deprecated_argument()` call from within a test.
* Declares an expected `_deprecated_function()` or `_deprecated_argument()` call from within a test.
*
* @since 4.2.0
*
Expand All @@ -270,7 +270,7 @@ public function setExpectedDeprecated($deprecated)
{
}
/**
* Declare an expected `_doing_it_wrong()` call from within a test.
* Declares an expected `_doing_it_wrong()` call from within a test.
*
* @since 4.2.0
*
Expand Down Expand Up @@ -364,9 +364,10 @@ public function assertDiscardWhitespace($expected, $actual)
* Asserts that two values have the same type and value, with EOL differences discarded.
*
* @since 5.6.0
* @since 5.8.0 Added support for nested arrays.
*
* @param string $expected The expected value.
* @param string $actual The actual value.
* @param string|array $expected The expected value.
* @param string|array $actual The actual value.
*/
public function assertSameIgnoreEOL($expected, $actual)
{
Expand Down Expand Up @@ -614,8 +615,8 @@ public function delete_folders($path)
{
}
/**
* Retrieves all directories contained inside a directory and stores them in the `$matched_dirs` property. Hidden
* directories are ignored.
* Retrieves all directories contained inside a directory and stores them in the `$matched_dirs` property.
* Hidden directories are ignored.
*
* This is a helper for the `delete_folders()` method.
*
Expand Down Expand Up @@ -1014,8 +1015,7 @@ public function get_max_num_pages($object_subtype = '')
* 'DIRECTORY' to the static variable WP_Test_Stream::$data['bucket']['/foo/']
* (note the trailing slash).
*
* This class can be used to test that code works with basic read/write streams,
* as such, operations such as seeking are not supported.
* This class can be used to test that code works with basic read/write streams.
*
* This class does not register itself as a stream handler: test fixtures
* should make the appropriate call to stream_wrapper_register().
Expand All @@ -1027,65 +1027,77 @@ class WP_Test_Stream
/**
* In-memory storage for files and directories simulated by this wrapper.
*/
static $data = array();
var $position;
var $file;
var $bucket;
var $data_ref;
public static $data = array();
public $position;
public $file;
public $bucket;
public $data_ref;
/**
* Opens a URL.
*
* @see streamWrapper::stream_open
*/
function stream_open($path, $mode, $options, &$opened_path)
public function stream_open($path, $mode, $options, &$opened_path)
{
}
/**
* Reads from a stream.
*
* @see streamWrapper::stream_read
*/
function stream_read($count)
public function stream_read($count)
{
}
/**
* Writes to a stream.
*
* @see streamWrapper::stream_write
*/
function stream_write($data)
public function stream_write($data)
{
}
/**
* Seeks to specific location in a stream.
*
* @see streamWrapper::stream_seek
*
* @param int $offset The stream offset to seek to.
* @param int $whence Optional. Seek position.
* @return bool Returns true when position is updated, else false.
*/
public function stream_seek($offset, $whence = \SEEK_SET)
{
}
/**
* Retrieves the current position of a stream.
*
* @see streamWrapper::stream_tell
*/
function stream_tell()
public function stream_tell()
{
}
/**
* Tests for end-of-file.
*
* @see streamWrapper::stream_eof
*/
function stream_eof()
public function stream_eof()
{
}
/**
* Change stream metadata.
*
* @see streamWrapper::stream_metadata
*/
function stream_metadata($path, $option, $var)
public function stream_metadata($path, $option, $var)
{
}
/**
* Creates a directory.
*
* @see streamWrapper::mkdir
*/
function mkdir($path, $mode, $options)
public function mkdir($path, $mode, $options)
{
}
/**
Expand Down Expand Up @@ -3466,12 +3478,6 @@ protected function _handleAjax($action)
*/
class Block_Supported_Styles_Test extends \WP_UnitTestCase
{
/**
* Sets up each test method.
*/
public function setUp()
{
}
/**
* Tear down each test method.
*/
Expand Down

0 comments on commit b044a74

Please sign in to comment.