ContentModelLogFormatterTest.php 1.4 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061
  1. <?php
  2. /**
  3. * @covers ContentModelLogFormatter
  4. */
  5. class ContentModelLogFormatterTest extends LogFormatterTestCase {
  6. public static function provideContentModelLogDatabaseRows() {
  7. return [
  8. [
  9. [
  10. 'type' => 'contentmodel',
  11. 'action' => 'new',
  12. 'comment' => 'new content model comment',
  13. 'namespace' => NS_MAIN,
  14. 'title' => 'ContentModelPage',
  15. 'params' => [
  16. '5::newModel' => 'testcontentmodel',
  17. ],
  18. ],
  19. [
  20. 'text' => 'User created the page ContentModelPage ' .
  21. 'using a non-default content model ' .
  22. '"testcontentmodel"',
  23. 'api' => [
  24. 'newModel' => 'testcontentmodel',
  25. ],
  26. ],
  27. ],
  28. [
  29. [
  30. 'type' => 'contentmodel',
  31. 'action' => 'change',
  32. 'comment' => 'change content model comment',
  33. 'namespace' => NS_MAIN,
  34. 'title' => 'ContentModelPage',
  35. 'params' => [
  36. '4::oldmodel' => 'wikitext',
  37. '5::newModel' => 'testcontentmodel',
  38. ],
  39. ],
  40. [
  41. 'text' => 'User changed the content model of the page ' .
  42. 'ContentModelPage from "wikitext" to ' .
  43. '"testcontentmodel"',
  44. 'api' => [
  45. 'oldmodel' => 'wikitext',
  46. 'newModel' => 'testcontentmodel',
  47. ],
  48. ],
  49. ],
  50. ];
  51. }
  52. /**
  53. * @dataProvider provideContentModelLogDatabaseRows
  54. */
  55. public function testContentModelLogDatabaseRows( $row, $extra ) {
  56. $this->doTestLogFormatter( $row, $extra );
  57. }
  58. }