[wp-trac] [WordPress Trac] #27411: Allow adding custom @ticket types for unit tests
WordPress Trac
noreply at wordpress.org
Mon Mar 17 09:07:20 UTC 2014
#27411: Allow adding custom @ticket types for unit tests
------------------------------+------------------------------
Reporter: rmccue | Owner:
Type: defect (bug) | Status: new
Priority: normal | Milestone: Awaiting Review
Component: Build/Test Tools | Version:
Severity: normal | Resolution:
Keywords: | Focuses:
------------------------------+------------------------------
Comment (by rmccue):
Replying to [comment:3 nacin]:
> The checkRequirements method, I imagine, would need to run a generic
knownBug method (or the like) for an @ticket it doesn't recognize. How
would it know whether the test should be skipped, otherwise?
>
> Seems to me like extending checkRequirements, calling
parent:checkedRequirements(), calling `$tickets =
PHPUnit_Util_Test::getTickets( get_class( $this ), $this->getName( false )
);` on your own, and such, is a better method. We could abstract out that
into a method, at least; that would help.
That's not so much an issue, as you can simply subclass and implement
`checkRequirements` yourself. The group-checking code, however, is a
global thing, so you have to create your own in parallel that basically
does exactly the same. (That is: it has no real code in it, whereas
`checkRequirements` handles calling the relevant API.)
> I've been thinking for some time now about getting rid of the skipped
test properties of @ticket. We now only commit tests with the code for
them, which tells me we could over time remove all existing "skipped"
tests. Indeed, we haven't exactly added any skipped tests in some time.
They'd still function as documentation as well as a shortcut for running
them.
I actually prefer this method, as it gives you an idea of what's currently
broken. That said, these types of tests (xfail) are a bit controversial,
so I could understand removing them.
--
Ticket URL: <https://core.trac.wordpress.org/ticket/27411#comment:4>
WordPress Trac <https://core.trac.wordpress.org/>
WordPress publishing platform
More information about the wp-trac
mailing list