Page MenuHomePhabricator

Write tests for page assessment tool
Closed, ResolvedPublic5 Story Points

Description

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 https://www.mediawiki.org/wiki/Manual:PHP_unit_testing/Writing_unit_tests#Databases 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 https://www.mediawiki.org/wiki/Manual:PHP_unit_testing/Writing_unit_tests_for_extensions 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.

Details

Related Gerrit Patches:
mediawiki/extensions/PageAssessments : masterTests for the PageAssessments extension

Event Timeline

DannyH created this task.Dec 8 2015, 6:13 PM
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.
Restricted Application added subscribers: StudiesWorld, Aklapper. · View Herald TranscriptDec 8 2015, 6:13 PM
DannyH set Security to None.
DannyH updated the task description. (Show Details)Dec 18 2015, 7:02 PM
kaldari updated the task description. (Show Details)Dec 18 2015, 7:03 PM
DannyH triaged this task as Normal 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.
kaldari updated the task description. (Show Details)Dec 18 2015, 11:33 PM
kaldari updated the task description. (Show Details)Dec 19 2015, 12:15 AM
Niharika claimed this task.Jan 25 2016, 7:56 AM
Niharika edited projects, added Community-Tech-Sprint; removed Community-Tech.
Niharika moved this task from Ready to In Development on the Community-Tech-Sprint board.

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

https://gerrit.wikimedia.org/r/266786

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

https://gerrit.wikimedia.org/r/266786

kaldari closed this task as Resolved.Feb 2 2016, 10:57 PM
kaldari moved this task from Needs Review/Feedback to Q3 2018-19 on the Community-Tech-Sprint board.
kaldari added a subscriber: kaldari.
DannyH moved this task from Estimated to Archive on the Community-Tech board.