Page MenuHomePhabricator

ContentModelLogFormatter does not have PHPUnit tests
Closed, ResolvedPublic


In MediaWiki core, the ContentModelLogFormatter (includes/logging/ContentModelLogFormatter.php) class does not have any tests.

If you're not already familiar with PHPUnit tests, has links to some good material on the basics of testing.

I would also recommend looking at other tests in the tests/phpunit/includes/logging directory of MediaWiki core for an example of how we currently test the log formatters.

I'll mentor this for Google-Code-in-2017


Related Gerrit Patches:

Event Timeline

Legoktm created this task.Jan 2 2018, 9:54 AM
Restricted Application added a subscriber: Aklapper. · View Herald TranscriptJan 2 2018, 9:54 AM
Ryan10145 claimed this task.Jan 7 2018, 9:31 PM

I noticed that the other tests in tests/phpunit/includes/logging have the comment

 * Provide different rows from the logging table to test
 * for backward compatibility.
 * Do not change the existing data, just add a new database row

Do I have to add multiple rows to the tests I am writing for ContentModelLogFormatter?

Those usually have multiple log rows because the format of the database entries changed in the migration to the new logging system. Since the content model log has only existed in the new logging system, I think one or two rows should be able to cover all of the functionality.

Thank you for the information!

Change 402755 had a related patch set uploaded (by Ryan10145; owner: Ryan10145):
[mediawiki/core@master] Added Tests for ContentModelLogFormatter

Change 402755 merged by jenkins-bot:
[mediawiki/core@master] Added Tests for ContentModelLogFormatter

Ryan10145 closed this task as Resolved.Jan 7 2018, 11:27 PM