[wp-trac] [WordPress Trac] #41451: Use pretty permalinks by default in the test suite
WordPress Trac
noreply at wordpress.org
Thu Dec 28 18:46:57 UTC 2017
#41451: Use pretty permalinks by default in the test suite
------------------------------------------+------------------------------
Reporter: johnbillion | Owner:
Type: enhancement | Status: new
Priority: normal | Milestone: Awaiting Review
Component: Build/Test Tools | Version:
Severity: normal | Resolution:
Keywords: needs-patch needs-unit-tests | Focuses:
------------------------------------------+------------------------------
Comment (by Frank Klein):
The patch above contains the code that makes all the tests, except three
multisite tests, pass with pretty permalinks enabled. I was unable to fix
these, so I'd be happy if somebody else could look into this.
[https://travis-ci.org/fklein-lu/wordpress-develop/jobs/322620789 This
Travis CI log] contains the failing tests:
- `Tests_Query_VerbosePageRules`: This keeps failing no matter what I try.
The way `WP_UnitTestCase::goto` behaves is not very transparent, and I
can't figure it out.
- `Tests_Rewrite_OldSlugRedirect` and `Tests_Feeds_RSS2` pass on local,
but fail on Travis.
A few notes about the patch:
- I did not account for non-Core test runs at this point. We could add a
bunch of `WP_RUN_CORE_TESTS` checks, but I feel like a more elegant
solution would be welcome.
- I introduced helper functions for permalink handling. I'm not a fan of
stuffing everything into `WP_UnitTestCase` if it doesn't need to be part
of the class. The helper functions are also more efficient, as
`UnitTestCase::set_permalink_structure` calls `WP_Rewrite::init` twice.
- I did only adapt the existing tests so that they pass. This might not
always be the past way for the thing being tested.
--
Ticket URL: <https://core.trac.wordpress.org/ticket/41451#comment:5>
WordPress Trac <https://core.trac.wordpress.org/>
WordPress publishing platform
More information about the wp-trac
mailing list