mirror of
https://gerrit.wikimedia.org/r/mediawiki/extensions/Cite
synced 2024-11-24 06:54:00 +00:00
Merge "Use $this->getServiceContainer() in tests"
This commit is contained in:
commit
4ad9c4c8eb
|
@ -5,7 +5,6 @@ declare( strict_types = 1 );
|
||||||
namespace Cite\Tests\Integration;
|
namespace Cite\Tests\Integration;
|
||||||
|
|
||||||
use ExtensionRegistry;
|
use ExtensionRegistry;
|
||||||
use MediaWiki\MediaWikiServices;
|
|
||||||
use Wikimedia\ObjectFactory\ObjectFactory;
|
use Wikimedia\ObjectFactory\ObjectFactory;
|
||||||
use Wikimedia\Parsoid\Core\SelserData;
|
use Wikimedia\Parsoid\Core\SelserData;
|
||||||
use Wikimedia\Parsoid\DOM\Element;
|
use Wikimedia\Parsoid\DOM\Element;
|
||||||
|
@ -31,9 +30,20 @@ class CiteParsoidTest extends \MediaWikiIntegrationTestCase {
|
||||||
}
|
}
|
||||||
|
|
||||||
private function getSiteConfig( $options ) {
|
private function getSiteConfig( $options ) {
|
||||||
$siteConfig = new class( $options ) extends MockSiteConfig {
|
$objectFactory = $this->getServiceContainer()->getObjectFactory();
|
||||||
|
$siteConfig = new class( $options, $objectFactory ) extends MockSiteConfig {
|
||||||
|
private ObjectFactory $objectFactory;
|
||||||
|
|
||||||
|
public function __construct(
|
||||||
|
array $opts,
|
||||||
|
ObjectFactory $objectFactory
|
||||||
|
) {
|
||||||
|
parent::__construct( $opts );
|
||||||
|
$this->objectFactory = $objectFactory;
|
||||||
|
}
|
||||||
|
|
||||||
public function getObjectFactory(): ObjectFactory {
|
public function getObjectFactory(): ObjectFactory {
|
||||||
return MediaWikiServices::getInstance()->getObjectFactory();
|
return $this->objectFactory;
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
// Ensure that the Cite module is registered!
|
// Ensure that the Cite module is registered!
|
||||||
|
|
Loading…
Reference in a new issue