Page MenuHomePhabricator

Write tests for page assessment tool
Closed, ResolvedPublic5 Estimated Story Points


Write php unit tests for most of the functions in PageAssessmentsBody class:

Acceptance criteria:

  • Create various tests for PageAssessmentsBody::execute() that exercise record inserting, updating, and deleting. The tests should assert that the data in the database matches expectations after running execute(). You can either utilize $this->assertSelect() from the MediaWikiTestCase parent class or write a simple getPageAssessments() function in PageAssessmentsBody to look at the resulting data.
  • Create a test for PageAssessmentsBody::getAllProjects().

See for how to set up database-related tests. For some examples, see extensions/Math/tests/MathDatabaseTest.php or extensions/Gather/tests/phpunit/api/GatherTest.php.

See for general documentation on how to write unit tests for extensions.

You may want to utilize addDBData() and insertPage() from the parent class, MediaWikiTestCase, during set-up.

Event Timeline

DannyH raised the priority of this task from to Needs Triage.
DannyH updated the task description. (Show Details)
DannyH added a project: Community-Tech.
DannyH moved this task to To Be Estimated/Discussed on the Community-Tech board.
DannyH added a subscriber: DannyH.
DannyH triaged this task as Medium priority.Dec 18 2015, 7:03 PM
DannyH edited a custom field.
DannyH moved this task from To Be Estimated/Discussed to Estimated on the Community-Tech board.

Change 266786 had a related patch set uploaded (by Niharika29):
Tests for the PageAssessments extension

Change 266786 merged by jenkins-bot:
Tests for the PageAssessments extension

kaldari moved this task from Needs Review/Feedback to Q3 2018-19 on the Community-Tech-Sprint board.
kaldari added a subscriber: kaldari.