mediawiki-extensions-Echo/tests/phpunit/integration/ServicesTest.php
Fomafix 829003cabf Use $this->getServiceContainer() in maintenance and tests
Use
	$this->getServiceContainer()
instead of
	MediaWikiServices::getInstance()
in maintenance and tests.

Change-Id: I845e8f083b19da093166d6551683f2013eec7bb1
2023-11-09 20:18:48 +00:00

46 lines
1.4 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 {
/** @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();
$this->assertInstanceOf( NotificationServiceClient::class, $serviceClient );
}
public function testGetPushSubscriptionManager(): void {
$subscriptionManager = $this->echoServices->getPushSubscriptionManager();
$this->assertInstanceOf( SubscriptionManager::class, $subscriptionManager );
}
public function testGetAttributeManager(): void {
$attributeManager = $this->echoServices->getAttributeManager();
$this->assertInstanceOf( AttributeManager::class, $attributeManager );
}
}