From 5880ac84ccfeda3365a80e096771a5a0ce88bc65 Mon Sep 17 00:00:00 2001 From: Sergey Biryukov Date: Thu, 7 Jul 2022 23:55:13 +0000 Subject: [PATCH] Tests: Separate the tests in `basic.php` for clarity. There were two kinds of tests in this file: * Tests for content of some files in the root directory: * `license.txt` * `SECURITY.md` * `package.json` * Tests for some utility functions of the test framework itself: * `strip_ws()` * `test_mask_input_value()` The latter are now moved to their own file, `utils.php`. Follow-up to [22/tests], [81/tests], [103/tests], [25240], [26940], [28064], [28480], [28493], [28523], [28631], [42381], [47403], [53683]. See #39265, #55652. git-svn-id: https://develop.svn.wordpress.org/trunk@53686 602fd350-edb4-49c9-b593-d223f7449a82 --- tests/phpunit/tests/basic.php | 58 ++-------------------------------- tests/phpunit/tests/utils.php | 59 +++++++++++++++++++++++++++++++++++ 2 files changed, 61 insertions(+), 56 deletions(-) create mode 100644 tests/phpunit/tests/utils.php diff --git a/tests/phpunit/tests/basic.php b/tests/phpunit/tests/basic.php index c9e752ecf7..954751d99e 100644 --- a/tests/phpunit/tests/basic.php +++ b/tests/phpunit/tests/basic.php @@ -1,11 +1,9 @@ assertArrayHasKey( 'engines', $package_json ); $this->assertArrayHasKey( 'node', $package_json['engines'] ); } - - /** - * Test some helper utility functions. - * - * @coversNothing - */ - public function test_strip_ws() { - $this->assertSame( '', strip_ws( '' ) ); - $this->assertSame( 'foo', strip_ws( 'foo' ) ); - $this->assertSame( '', strip_ws( "\r\n\t \n\r\t" ) ); - - $in = "asdf\n"; - $in .= "asdf asdf\n"; - $in .= "asdf asdf\n"; - $in .= "\tasdf\n"; - $in .= "\tasdf\t\n"; - $in .= "\t\tasdf\n"; - $in .= "foo bar\n\r\n"; - $in .= "foo\n"; - - $expected = "asdf\n"; - $expected .= "asdf asdf\n"; - $expected .= "asdf asdf\n"; - $expected .= "asdf\n"; - $expected .= "asdf\n"; - $expected .= "asdf\n"; - $expected .= "foo bar\n"; - $expected .= 'foo'; - - $this->assertSame( $expected, strip_ws( $in ) ); - - } - - /** - * @coversNothing - */ - public function test_mask_input_value() { - $in = <<Assign Authors -

To make it easier for you to edit and save the imported posts and drafts, you may want to change the name of the author of the posts. For example, you may want to import all the entries as admins entries.

-

If a new user is created by WordPress, the password will be set, by default, to "changeme". Quite suggestive, eh? ;)

-
  1. Current author: Alex Shiels
    Create user
    or map to existing
  2. Current author: Alex Shiels
    Create user
    or map to existing
  3. Current author: Alex Shiels
    Create user
    or map to existing
  4. Current author: Alex Shiels
    Create user
    or map to existing