Michael added a comment.

  Parking this here, this or something like this should be added to 
`MediaWikiRevisionSchemaWriterTest` when implementing this ticket.
  
        public function testUpdateMultiLingualSchemaNameBadgeSuccess() {
                $id = 'O1';
                $language = 'en';
                $englishLabel = 'Goat';
                $englishDescription = 'This is what a goat looks like';
                $englishAliases = [ 'Capra' ];
                $existingContent = new WikibaseSchemaContent( json_encode( [
                        'id' => $id,
                        'serializationVersion' => '2.0',
                        'labels' => [
                                'en' => 'Cat',
                                'de' => 'Ziege',
                        ],
                        'descriptions' => [
                                'en' => 'This is what a cat looks like',
                                'de' => 'Wichtigste Eigenschaften einer Ziege'
                        ],
                        'aliases' => [
                                'en' => [ 'Tiger', 'Lion' ],
                                'de' => [ 'Capra', 'Hausziege' ]
                        ],
                        'schema' => '# some schema about goats',
                        'type' => 'ShExC',
                ] ) );
                $expectedContent = new WikibaseSchemaContent( json_encode( [
                        'id' => $id,
                        'serializationVersion' => '2.0',
                        'labels' => [
                                'en' => $englishLabel,
                                'de' => 'Ziege',
                        ],
                        'descriptions' => [
                                'en' => $englishDescription,
                                'de' => 'Wichtigste Eigenschaften einer Ziege'
                        ],
                        'aliases' => [
                                'en' => $englishAliases,
                                'de' => [ 'Capra', 'Hausziege' ]
                        ],
                        'schema' => '# some schema about goats',
                        'type' => 'ShExC',
                ] ) );
    
                $pageUpdaterFactory = $this
                        ->getPageUpdaterFactoryProvidingAndExpectingContent( 
$expectedContent, $existingContent );
                $writer = new MediaWikiRevisionSchemaWriter(
                        $pageUpdaterFactory,
                        $this->getMessageLocalizer(),
                        $this->getMockWatchlistUpdater( 
'optionallyWatchEditedSchema' )
                );
    
                $writer->updateSchemaNameBadge(
                        new SchemaId( $id ),
                        $language,
                        $englishLabel,
                        $englishDescription,
                        $englishAliases
                );
        }

TASK DETAIL
  https://phabricator.wikimedia.org/T216145

EMAIL PREFERENCES
  https://phabricator.wikimedia.org/settings/panel/emailpreferences/

To: Michael
Cc: Michael, Lydia_Pintscher, Aklapper, Lucas_Werkmeister_WMDE, pdehaye, 
Nandana, Lahi, Gq86, GoranSMilovanovic, QZanden, YULdigitalpreservation, 
LawExplorer, _jensen, abian, Wikidata-bugs, aude, Tpt, Mbch331
_______________________________________________
Wikidata-bugs mailing list
[email protected]
https://lists.wikimedia.org/mailman/listinfo/wikidata-bugs

Reply via email to