mirror of
https://github.com/Combodo/iTop.git
synced 2026-02-12 23:14:18 +01:00
N°7726 - Fatal error if a newsroom is sent without any message
Finalization of tests
This commit is contained in:
@@ -58,12 +58,44 @@ class ActionNewsroomTest extends ItopDataTestCase
|
||||
];
|
||||
}
|
||||
|
||||
/**
|
||||
* @throws CoreException
|
||||
* @throws MissingQueryArgument
|
||||
* @throws CoreUnexpectedValue
|
||||
* @throws ArchivedObjectException
|
||||
* @throws MySQLException
|
||||
* @throws MySQLHasGoneAwayException
|
||||
* @throws Exception
|
||||
*/
|
||||
public function testActionNewsroomRecordsEvent()
|
||||
{
|
||||
$iActionNewsroomId = $this->GivenActionNewsroomInDB(false, 'Body of the notification');
|
||||
|
||||
$this->CreateUserRequest(1,
|
||||
[
|
||||
'title' => '[TEST] ActionNewsroom',
|
||||
'org_id' => $this->getTestOrgId(),
|
||||
'caller_id' => $this->iRecipientId,
|
||||
'description' => 'PHPUnit Test',
|
||||
]
|
||||
);
|
||||
|
||||
$this->AssertUniqueObjectInDB(
|
||||
'EventNotificationNewsroom',
|
||||
[
|
||||
'action_id' => $iActionNewsroomId,
|
||||
'message' => 'Body of the notification',
|
||||
'title' => 'Title'
|
||||
]
|
||||
);
|
||||
}
|
||||
|
||||
/**
|
||||
* @dataProvider ActionNewsroomProvider
|
||||
* @return void
|
||||
* @throws Exception
|
||||
*/
|
||||
public function testActionNewsroomRecordsEventIfAMandatoryFieldIsEmpty(bool $bIsAsynchronous)
|
||||
public function testActionNewsroomRecordsSpecificEventIfAMandatoryFieldIsEmpty(bool $bIsAsynchronous)
|
||||
{
|
||||
$iActionNewsroomId = $this->GivenActionNewsroomInDB($bIsAsynchronous, '$this->service_name$');
|
||||
|
||||
@@ -87,43 +119,6 @@ class ActionNewsroomTest extends ItopDataTestCase
|
||||
);
|
||||
}
|
||||
|
||||
/**
|
||||
* @throws CoreException
|
||||
* @throws MissingQueryArgument
|
||||
* @throws CoreUnexpectedValue
|
||||
* @throws ArchivedObjectException
|
||||
* @throws MySQLException
|
||||
* @throws MySQLHasGoneAwayException
|
||||
* @throws Exception
|
||||
*/
|
||||
public function testActionNewsroomRecordsEvent()
|
||||
{
|
||||
$iActionNewsroomId = $this->GivenActionNewsroomInDB(false, 'Body of the notification');
|
||||
|
||||
$iServiceId = $this->GivenService('Test service');
|
||||
|
||||
$this->CreateUserRequest(1,
|
||||
[
|
||||
'title' => '[TEST] ActionNewsroom',
|
||||
'org_id' => $this->getTestOrgId(),
|
||||
'caller_id' => $this->iRecipientId,
|
||||
'description' => 'PHPUnit Test',
|
||||
'service_id' => 0
|
||||
]
|
||||
);
|
||||
|
||||
|
||||
|
||||
$this->AssertUniqueObjectInDB(
|
||||
'EventNotificationNewsroom',
|
||||
[
|
||||
'action_id' => $iActionNewsroomId,
|
||||
'message' => 'Body of the notification'
|
||||
]
|
||||
);
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* @throws Exception
|
||||
*/
|
||||
|
||||
Reference in New Issue
Block a user