getServiceContainer(); $hookContainer = $services->getHookContainer(); $factory = new ContributeFactory( $context, new HookRunner( $hookContainer ) ); $cards = $factory->getCards(); $this->assertIsArray( $cards ); $this->assertNotEmpty( $cards ); $defaltCard = $cards[ count( $cards ) - 1 ]; $expectedCard = ( new ContributeCard( $context->msg( 'newpage' )->text(), $context->msg( 'newpage-desc' )->text(), 'article', new ContributeCardActionLink( SpecialPage::getSafeTitleFor( 'Wantedpages' )->getLocalURL(), $context->msg( 'view-missing-pages' )->text() ) ) )->toArray(); $this->assertArrayEquals( [ 'title', 'icon', 'description', 'action' ], array_keys( $defaltCard ) ); $this->assertArrayEquals( $expectedCard, $defaltCard ); } }