MediaWiki  master
RevisionMcrReadNewDbTest.php
Go to the documentation of this file.
1 <?php
2 
6 
19 
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 }
const CONTENT_MODEL_WIKITEXT
Definition: Defines.php:231
Tests Revision against the intermediate MCR DB schema for use during schema migration.
Apache License January AND DISTRIBUTION Definitions License shall mean the terms and conditions for use
Value object representing a content slot associated with a page revision.
Definition: SlotRecord.php:39
Mutable RevisionRecord implementation, for building new revision entries programmatically.
this hook is for auditing only or null if authentication failed before getting that far or null if we can t even determine that When $user is not null
Definition: hooks.txt:780
injection txt This is an overview of how MediaWiki makes use of dependency injection The design described here grew from the discussion of RFC T384 The term dependency this means that anything an object needs to operate should be injected from the the object itself should only know narrow no concrete implementation of the logic it relies on The requirement to inject everything typically results in an architecture that based on two main types of and essentially stateless service objects that use other service objects to operate on the value objects As of the beginning MediaWiki is only starting to use the DI approach Much of the code still relies on global state or direct resulting in a highly cyclical dependency which acts as the top level factory for services in MediaWiki which can be used to gain access to default instances of various services MediaWikiServices however also allows new services to be defined and default services to be redefined Services are defined or redefined by providing a callback the instantiator that will return a new instance of the service When it will create an instance of MediaWikiServices and populate it with the services defined in the files listed by thereby bootstrapping the DI framework Per $wgServiceWiringFiles lists includes ServiceWiring php
Definition: injection.txt:35
RevisionDbTestBase contains test cases for the Revision class that have Database interactions.
trait McrReadNewSchemaOverride
Trait providing schema overrides that allow tests to run against the intermediate MCR database schema...