mediawiki-extensions-Echo/tests/phpunit/integration/EchoServicesTest.php
Jeena Huneidi 596729d852 Make AttributeManager a service
Adds AttributeManager to EchoServices so that dependencies of
AttributeManager can be injected.

Bug: T275148
Change-Id: I4fa5084d72914d16b6d218e7dd3521f5a1919b80
2021-02-26 12:58:23 -08:00

39 lines
1.1 KiB
PHP

<?php
use EchoPush\NotificationServiceClient;
use EchoPush\SubscriptionManager;
use MediaWiki\MediaWikiServices;
/** @covers EchoServices */
class EchoServicesTest extends MediaWikiIntegrationTestCase {
/** @var EchoServices */
private $echoServices;
public function setUp(): void {
parent::setUp();
$this->echoServices = EchoServices::getInstance();
}
public function testWrap(): void {
$services = EchoServices::wrap( MediaWikiServices::getInstance() );
$this->assertInstanceOf( EchoServices::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( EchoAttributeManager::class, $attributeManager );
}
}