Merge "Don't hold reference to MediaWikiServices instance in tests"

This commit is contained in:
jenkins-bot 2024-06-27 07:52:41 +00:00 committed by Gerrit Code Review
commit b6868dbe70

View file

@ -14,31 +14,23 @@ use MediaWikiIntegrationTestCase;
*/
class ServicesTest extends MediaWikiIntegrationTestCase {
/** @var Services */
private $echoServices;
protected function setUp(): void {
parent::setUp();
$this->echoServices = Services::getInstance();
}
public function testWrap(): void {
$services = Services::wrap( $this->getServiceContainer() );
$this->assertInstanceOf( Services::class, $services );
}
public function testGetPushNotificationServiceClient(): void {
$serviceClient = $this->echoServices->getPushNotificationServiceClient();
$serviceClient = Services::getInstance()->getPushNotificationServiceClient();
$this->assertInstanceOf( NotificationServiceClient::class, $serviceClient );
}
public function testGetPushSubscriptionManager(): void {
$subscriptionManager = $this->echoServices->getPushSubscriptionManager();
$subscriptionManager = Services::getInstance()->getPushSubscriptionManager();
$this->assertInstanceOf( SubscriptionManager::class, $subscriptionManager );
}
public function testGetAttributeManager(): void {
$attributeManager = $this->echoServices->getAttributeManager();
$attributeManager = Services::getInstance()->getAttributeManager();
$this->assertInstanceOf( AttributeManager::class, $attributeManager );
}