Unit tests

SVN:b1162[5530]
This commit is contained in:
Eric Espié
2018-03-26 15:02:24 +00:00
parent ac5d24a848
commit f0c8b348c6
2 changed files with 10 additions and 8 deletions

View File

@@ -37,7 +37,6 @@ use Hypervisor;
use lnkContactToFunctionalCI;
use MetaModel;
use Person;
use PHPUnit\Framework\TestCase;
use Server;
use Ticket;
use URP_UserProfile;
@@ -144,7 +143,7 @@ class ItopDataTestCase extends ItopTestCase
$oTicket = self::createObject('UserRequest', array(
'ref' => 'Ticket_'.$iNum,
'title' => 'BUG 789_'.$iNum,
'request_type' => 'incident',
//'request_type' => 'incident',
'description' => 'method UpdateImpactedItems() reconstruit le lnkContactToTicket donc impossible de rajouter des champs dans cette classe',
'org_id' => $this->getTestOrgId(),
));
@@ -168,7 +167,7 @@ class ItopDataTestCase extends ItopTestCase
$oTicket = self::createObject('UserRequest', array(
'ref' => 'Ticket_'.$iNum,
'title' => 'BUG 1161_'.$iNum,
'request_type' => 'incident',
//'request_type' => 'incident',
'description' => 'Add aggregate functions',
'time_spent' => $iTimeSpent,
'caller_id' => $iCallerId,
@@ -180,16 +179,20 @@ class ItopDataTestCase extends ItopTestCase
/**
* Create a Server in database
*
* @param int $iNum
* @param null $iRackUnit
*
* @return Server
* @throws Exception
* @throws \Exception
*/
protected function CreateServer($iNum)
protected function CreateServer($iNum, $iRackUnit = null)
{
/** @var Server $oServer */
$oServer = self::createObject('Server', array(
'name' => 'Server_'.$iNum,
'org_id' => $this->getTestOrgId(),
'nb_u' => $iRackUnit,
));
$this->debug("Created {$oServer->GetName()} ({$oServer->GetKey()})");
return $oServer;