Page MenuHomePhabricator

[Task] PHPUnit tests for API modules should bypass API framework.
Open, MediumPublic

Description

Currently, unit tests for API modules emulate HTTP calls and rely on global state, both in PHP and in the database, to provide fixtures.

To simplify and speed up testing, we need a facility to instantiate API modules and inject (mock) services into them. Such a facility should be shared by all API tests.

Details

Reference
bz55516

Event Timeline

bzimport raised the priority of this task from to High.Nov 22 2014, 2:20 AM
bzimport set Reference to bz55516.
bzimport added a subscriber: Unknown Object (MLST).

Less important after recent changes to core that made API tests way faster.

Lydia_Pintscher removed a subscriber: Unknown Object (MLST).
Lydia_Pintscher removed a subscriber: Unknown Object (MLST).Dec 1 2014, 2:33 PM

This should become easier with the work that I plan on doing over Wikimania.
Essentially we need Integration tests for all API modules before doing this too (really)...
These integration tests could just be added to ApiXmlFormatTest :)

Addshore renamed this task from Unit tests for API modules should bypass API framework. to PHP Unit tests for API modules should bypass API framework..Jul 9 2015, 3:01 PM
Addshore set Security to None.
thiemowmde renamed this task from PHP Unit tests for API modules should bypass API framework. to [Task] PHPUnit tests for API modules should bypass API framework..Aug 13 2015, 4:18 PM
thiemowmde updated the task description. (Show Details)
thiemowmde removed a subscriber: Wikidata-bugs.
hoo lowered the priority of this task from High to Medium.Oct 28 2016, 3:24 PM