mirror of
https://github.com/Combodo/iTop.git
synced 2026-04-25 11:38:44 +02:00
N°8796 - Add PHP code style validation in iTop and extensions - format whole code base
This commit is contained in:
@@ -5,10 +5,8 @@
|
||||
* @license http://opensource.org/licenses/AGPL-3.0
|
||||
*/
|
||||
|
||||
|
||||
namespace Combodo\iTop\Test\UnitTest\Service\Notification;
|
||||
|
||||
|
||||
use Combodo\iTop\Core\Trigger\Enum\SubscriptionPolicy;
|
||||
use Combodo\iTop\Service\Notification\NotificationsRepository;
|
||||
use Combodo\iTop\Service\Notification\NotificationsService;
|
||||
@@ -21,7 +19,8 @@ use Combodo\iTop\Test\UnitTest\ItopDataTestCase;
|
||||
* @package Combodo\iTop\Test\UnitTest\Service\Notification
|
||||
* @covers \Combodo\iTop\Service\Notification\NotificationsService
|
||||
*/
|
||||
class NotificationsServiceTest extends ItopDataTestCase {
|
||||
class NotificationsServiceTest extends ItopDataTestCase
|
||||
{
|
||||
public const CREATE_TEST_ORG = true;
|
||||
|
||||
/**
|
||||
@@ -59,14 +58,12 @@ class NotificationsServiceTest extends ItopDataTestCase {
|
||||
]);
|
||||
$iActionNotificationID = $oActionNotification->GetKey();
|
||||
|
||||
|
||||
$oService = NotificationsService::GetInstance();
|
||||
|
||||
// Case 1: Person hasn't received action so far, so it is implicitly subscribed by default
|
||||
// - Assert
|
||||
$this->assertTrue($oService->IsSubscribed($oTrigger, $oActionNotification, $oPerson));
|
||||
|
||||
|
||||
// Case 2: Activate an action, the person should have an explicit subscription
|
||||
// - Prepare
|
||||
$oActionNotification->DoExecute($oTrigger, [
|
||||
@@ -79,7 +76,6 @@ class NotificationsServiceTest extends ItopDataTestCase {
|
||||
$this->assertEquals(1, $iSubscribedCount, "There should be 1 explicit subscription");
|
||||
$this->assertTrue($oService->IsSubscribed($oTrigger, $oActionNotification, $oPerson));
|
||||
|
||||
|
||||
// Case 3: Unsubscribe, person should have an explicit unsubscribe
|
||||
// - Prepare
|
||||
$oSubscription = NotificationsRepository::GetInstance()->SearchSubscribedSubscriptionsByTriggerContactAndAction($iTriggerID, $iActionNotificationID, $iPersonID)->Fetch();
|
||||
@@ -93,4 +89,4 @@ class NotificationsServiceTest extends ItopDataTestCase {
|
||||
$this->assertEquals(1, $iUnsubscribedCount, "There should be 1 explicit unsubscription");
|
||||
$this->assertFalse($oService->IsSubscribed($oTrigger, $oActionNotification, $oPerson));
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user