MediaWiki
REL1_32
RevisionMcrDbTest.php
Go to the documentation of this file.
1
<?php
2
3
use
MediaWiki\Revision\MutableRevisionRecord
;
4
use
MediaWiki\Revision\SlotRecord
;
5
use MediaWiki\Tests\Revision\McrSchemaOverride;
6
18
class
RevisionMcrDbTest
extends
RevisionDbTestBase
{
19
20
use McrSchemaOverride;
21
22
public
function
setUp
() {
23
parent::setUp();
24
}
25
26
protected
function
getContentHandlerUseDB
() {
27
return
true
;
28
}
29
30
public
function
provideGetTextId
() {
31
yield [ [], null ];
32
33
$slot =
new
SlotRecord
( (
object
)[
34
'slot_revision_id'
=> 42,
35
'slot_content_id'
=> 1,
36
'content_address'
=>
'tt:789'
,
37
'model_name'
=>
CONTENT_MODEL_WIKITEXT
,
38
'role_name'
=> SlotRecord::MAIN,
39
'slot_origin'
=> 1,
40
],
new
WikitextContent
(
'Test'
) );
41
42
$rec =
new
MutableRevisionRecord
( $this->
getMockTitle
() );
43
$rec->setId( 42 );
44
$rec->setSlot( $slot );
45
46
yield [ $rec, 789 ];
47
}
48
49
}
MediaWiki\Revision\MutableRevisionRecord
Mutable RevisionRecord implementation, for building new revision entries programmatically.
Definition
MutableRevisionRecord.php:41
MediaWiki\Revision\SlotRecord
Value object representing a content slot associated with a page revision.
Definition
SlotRecord.php:39
RevisionDbTestBase
RevisionDbTestBase contains test cases for the Revision class that have Database interactions.
Definition
RevisionDbTestBase.php:15
RevisionDbTestBase\getMockTitle
getMockTitle()
Definition
RevisionDbTestBase.php:112
RevisionMcrDbTest
Tests Revision against the MCR DB schema after schema migration.
Definition
RevisionMcrDbTest.php:18
RevisionMcrDbTest\getContentHandlerUseDB
getContentHandlerUseDB()
Definition
RevisionMcrDbTest.php:26
RevisionMcrDbTest\setUp
setUp()
Definition
RevisionMcrDbTest.php:22
RevisionMcrDbTest\provideGetTextId
provideGetTextId()
Definition
RevisionMcrDbTest.php:30
WikitextContent
Content object for wiki text pages.
Definition
WikitextContent.php:35
CONTENT_MODEL_WIKITEXT
const CONTENT_MODEL_WIKITEXT
Definition
Defines.php:235
tests
phpunit
includes
RevisionMcrDbTest.php
Generated on Mon Nov 25 2024 15:58:52 for MediaWiki by
1.10.0