[wp-trac] [WordPress Trac] #41123: Modified `WP_TESTS_TITLE` causes dirty wp-api-generated.js
WordPress Trac
noreply at wordpress.org
Wed Jul 5 09:19:48 UTC 2017
#41123: Modified `WP_TESTS_TITLE` causes dirty wp-api-generated.js
--------------------------+------------------------------
Reporter: boonebgorges | Owner: jnylen0
Type: defect (bug) | Status: accepted
Priority: normal | Milestone: Awaiting Review
Component: REST API | Version: 4.7
Severity: normal | Resolution:
Keywords: | Focuses:
--------------------------+------------------------------
Changes (by jnylen0):
* owner: => jnylen0
* status: new => accepted
Comment:
Here is how to use [attachment:compare-wp-api-fixtures.js] to generate a
patch like [attachment:41123.2.diff]:
1. In `tests/phpunit/tests/rest-api/rest-schema-setup.php`, set `private
static $fixture_replacements` to an '''empty array'''.
2. In `wp-tests-config`, set the `WP_TESTS_*` constants to their default
values:
{{{
define( 'WP_TESTS_DOMAIN', 'example.org' );
define( 'WP_TESTS_EMAIL', 'admin at example.org' );
define( 'WP_TESTS_TITLE', 'Test Blog' );
}}}
3. Run these commands:
{{{
phpunit --filter WP_Test_REST_Schema_Initialization
cp tests/qunit/fixtures/wp-api-generated.js wp-api-generated-1class.js
}}}
4. Set the `WP_TESTS_*` constants to something '''other than''' the
default values. For example:
{{{
define( 'WP_TESTS_DOMAIN', 'not-example.org' );
define( 'WP_TESTS_EMAIL', 'admin at not-example.org' );
define( 'WP_TESTS_TITLE', 'Super Test Blog' );
}}}
5. Run these commands:
{{{
phpunit --filter REST
cp tests/qunit/fixtures/wp-api-generated.js wp-api-generated-REST.js
}}}
6. Download [attachment:compare-wp-api-fixtures.js] from this ticket to
your WP install.
7. Run these commands:
{{{
npm install deep-diff at 0.3.4
node compare-wp-api-fixtures.js
}}}
8. Copy the `stdout` result of the Node.js script into the
`$fixture_replacements` array.
--
Ticket URL: <https://core.trac.wordpress.org/ticket/41123#comment:3>
WordPress Trac <https://core.trac.wordpress.org/>
WordPress publishing platform
More information about the wp-trac
mailing list