WikiPagePreMcrDbTest.php 1.0 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152
  1. <?php
  2. use MediaWiki\Tests\Storage\PreMcrSchemaOverride;
  3. /**
  4. * Tests WikiPage against the pre-MCR DB schema.
  5. *
  6. * @covers WikiPage
  7. *
  8. * @group WikiPage
  9. * @group Storage
  10. * @group ContentHandler
  11. * @group Database
  12. * @group medium
  13. */
  14. class WikiPagePreMcrDbTest extends WikiPageDbTestBase {
  15. use PreMcrSchemaOverride;
  16. protected function getContentHandlerUseDB() {
  17. return true;
  18. }
  19. /**
  20. * @covers WikiPage::getContentModel
  21. */
  22. public function testGetContentModel() {
  23. $page = $this->createPage(
  24. __METHOD__,
  25. "some text",
  26. CONTENT_MODEL_JAVASCRIPT
  27. );
  28. $page = new WikiPage( $page->getTitle() );
  29. $this->assertEquals( CONTENT_MODEL_JAVASCRIPT, $page->getContentModel() );
  30. }
  31. /**
  32. * @covers WikiPage::getContentHandler
  33. */
  34. public function testGetContentHandler() {
  35. $page = $this->createPage(
  36. __METHOD__,
  37. "some text",
  38. CONTENT_MODEL_JAVASCRIPT
  39. );
  40. $page = new WikiPage( $page->getTitle() );
  41. $this->assertEquals( JavaScriptContentHandler::class, get_class( $page->getContentHandler() ) );
  42. }
  43. }