Write php unit tests for most of the functions in page assessments body class: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.
{T117142}* Create a test for PageAssessmentsBody::getAllProjects().
Tests for GetAllProjects,See https://www.mediawiki.org/wiki/Manual:PHP_unit_testing/Writing_unit_tests#Databases for how to set up database-related tests. Insert recordFor some examples, update record, delete recordsee 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#Databases for how to set up database-related tests. For an example, see extensions/Math/_for_extensions for general documentation on how to write unit tests/MathDatabaseTest.php for extensions.
You may want to utilize addDBData() and insertPage() from the parent class, MediaWikiTestCase, during set-up.