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.