mediawiki-extensions-Echo/tests/phpunit/integration/ServicesTest.php
thiemowmde e87cf704f4 Don't hold reference to MediaWikiServices instance in tests
There is no guarantee the MediaWikiServices instance is still valid.
Other tests can reset it.

Bug: T368390
Change-Id: I92de60b2ba5fb66af957a800ce85773db58303cc
2024-06-26 11:27:22 +02:00

38 lines
1.3 KiB
PHP

<?php
namespace MediaWiki\Extension\Notifications\Test\Integration;
use MediaWiki\Extension\Notifications\AttributeManager;
use MediaWiki\Extension\Notifications\Push\NotificationServiceClient;
use MediaWiki\Extension\Notifications\Push\SubscriptionManager;
use MediaWiki\Extension\Notifications\Services;
use MediaWikiIntegrationTestCase;
/**
* @covers \MediaWiki\Extension\Notifications\Services
* @group Database
*/
class ServicesTest extends MediaWikiIntegrationTestCase {
public function testWrap(): void {
$services = Services::wrap( $this->getServiceContainer() );
$this->assertInstanceOf( Services::class, $services );
}
public function testGetPushNotificationServiceClient(): void {
$serviceClient = Services::getInstance()->getPushNotificationServiceClient();
$this->assertInstanceOf( NotificationServiceClient::class, $serviceClient );
}
public function testGetPushSubscriptionManager(): void {
$subscriptionManager = Services::getInstance()->getPushSubscriptionManager();
$this->assertInstanceOf( SubscriptionManager::class, $subscriptionManager );
}
public function testGetAttributeManager(): void {
$attributeManager = Services::getInstance()->getAttributeManager();
$this->assertInstanceOf( AttributeManager::class, $attributeManager );
}
}