Remove hard deprecation of PasswordPolicyChecks::checkPopularPasswordBlacklist
[lhc/web/wiklou.git] / tests / phpunit / includes / RevisionMcrReadNewDbTest.php
1 <?php
2
3 use MediaWiki\Revision\MutableRevisionRecord;
4 use MediaWiki\Revision\SlotRecord;
5 use MediaWiki\Tests\Revision\McrReadNewSchemaOverride;
6
7 /**
8 * Tests Revision against the intermediate MCR DB schema for use during schema migration.
9 *
10 * @covers Revision
11 *
12 * @group Revision
13 * @group Storage
14 * @group ContentHandler
15 * @group Database
16 * @group medium
17 */
18 class RevisionMcrReadNewDbTest extends RevisionDbTestBase {
19
20 use McrReadNewSchemaOverride;
21
22 protected function getContentHandlerUseDB() {
23 return true;
24 }
25
26 public function provideGetTextId() {
27 yield [ [], null ];
28
29 $slot = new SlotRecord( (object)[
30 'slot_revision_id' => 42,
31 'slot_content_id' => 1,
32 'content_address' => 'tt:789',
33 'model_name' => CONTENT_MODEL_WIKITEXT,
34 'role_name' => SlotRecord::MAIN,
35 'slot_origin' => 1,
36 ], new WikitextContent( 'Test' ) );
37
38 $rec = new MutableRevisionRecord( $this->getMockTitle() );
39 $rec->setId( 42 );
40 $rec->setSlot( $slot );
41
42 yield [ $rec, 789 ];
43 }
44
45 public function provideGetRevisionText() {
46 yield 'no text table' => [
47 []
48 ];
49 yield 'force text table' => [
50 [],
51 [
52 'tables' => [ 'text' ],
53 'fields' => [ 'old_id', 'old_text', 'old_flags', 'rev_text_id' ],
54 'joins' => [ 'text' => [ 'JOIN', 'old_id=rev_text_id' ] ]
55 ]
56 ];
57 }
58
59 }