mirror of
https://github.com/Combodo/iTop.git
synced 2026-04-24 11:08:45 +02:00
Merge remote-tracking branch 'origin/support/3.2' into develop
# Conflicts: # .doc/itop-version-history.md
This commit is contained in:
@@ -61,88 +61,6 @@ class TestBeSad extends TestHandler
|
||||
}
|
||||
}
|
||||
|
||||
class TestSQLQuery extends TestScenarioOnDB
|
||||
{
|
||||
static public function GetName() {return 'SQLQuery';}
|
||||
static public function GetDescription() {return 'SQLQuery does not depend on the rest of the framework, therefore it makes sense to have a separate test framework for it';}
|
||||
|
||||
static public function GetDBHost() {return 'localhost';}
|
||||
static public function GetDBUser() {return 'root';}
|
||||
static public function GetDBPwd() {return '';}
|
||||
static public function GetDBName() {return 'TestSQLQuery';}
|
||||
static public function GetDBSubName() {return 'taratata';}
|
||||
|
||||
|
||||
protected function DoPrepare()
|
||||
{
|
||||
parent::DoPrepare();
|
||||
cmdbSource::CreateTable('CREATE TABLE `myTable` (myKey INT(11) NOT NULL auto_increment, column1 VARCHAR(255), column2 VARCHAR(255), PRIMARY KEY (`myKey`)) ENGINE = '.MYSQL_ENGINE);
|
||||
cmdbSource::CreateTable('CREATE TABLE `myTable1` (myKey1 INT(11) NOT NULL auto_increment, column1_1 VARCHAR(255), column1_2 VARCHAR(255), PRIMARY KEY (`myKey1`)) ENGINE = '.MYSQL_ENGINE);
|
||||
cmdbSource::CreateTable('CREATE TABLE `myTable2` (myKey2 INT(11) NOT NULL auto_increment, column2_1 VARCHAR(255), column2_2 VARCHAR(255), PRIMARY KEY (`myKey2`)) ENGINE = '.MYSQL_ENGINE);
|
||||
}
|
||||
|
||||
protected function DoExecute()
|
||||
{
|
||||
$oQuery = new SQLObjectQuery(
|
||||
$sTable = 'myTable',
|
||||
$sTableAlias = 'myTableAlias',
|
||||
$aFields = array('column1'=>new FieldExpression('column1', 'myTableAlias'), 'column2'=>new FieldExpression('column2', 'myTableAlias')),
|
||||
// $aFullTextNeedles = array('column1'),
|
||||
$bToDelete = false,
|
||||
$aValues = array()
|
||||
);
|
||||
$oQuery->AddCondition(Expression::FromOQL('DATE(NOW() - 1200 * 2) > \'2008-07-31\''));
|
||||
|
||||
$oSubQuery1 = new SQLObjectQuery(
|
||||
$sTable = 'myTable1',
|
||||
$sTableAlias = 'myTable1Alias',
|
||||
$aFields = array('column1_1'=>new FieldExpression('column1', 'myTableAlias'), 'column1_2'=>new FieldExpression('column1', 'myTableAlias')),
|
||||
// $aFullTextNeedles = array(),
|
||||
$bToDelete = false,
|
||||
$aValues = array()
|
||||
);
|
||||
|
||||
$oSubQuery2 = new SQLObjectQuery(
|
||||
$sTable = 'myTable2',
|
||||
$sTableAlias = 'myTable2Alias',
|
||||
$aFields = array('column2_1'=>new FieldExpression('column2', 'myTableAlias'), 'column2_2'=>new FieldExpression('column2', 'myTableAlias')),
|
||||
// $aFullTextNeedles = array(),
|
||||
$bToDelete = false,
|
||||
$aValues = array()
|
||||
);
|
||||
|
||||
$oQuery->AddInnerJoin($oSubQuery1, 'column1', 'column1_1');
|
||||
$oQuery->AddLeftJoin($oSubQuery2, 'column2', 'column2_2');
|
||||
|
||||
$oQuery->DisplayHtml();
|
||||
$oQuery->RenderDelete();
|
||||
$oQuery->RenderUpdate();
|
||||
echo '<p>'.$oQuery->RenderSelect().'</p>';
|
||||
$oQuery->RenderSelect(array('column1'));
|
||||
$oQuery->RenderSelect(array('column1', 'column2'));
|
||||
}
|
||||
}
|
||||
|
||||
class TestGenericItoMyModel extends TestBizModelGeneric
|
||||
{
|
||||
static public function GetName()
|
||||
{
|
||||
return 'Generic RO test on '.self::GetConfigFile();
|
||||
}
|
||||
|
||||
static public function GetConfigFile() {return '/config-test-mymodel.php';}
|
||||
}
|
||||
|
||||
class TestGenericItopBigModel extends TestBizModelGeneric
|
||||
{
|
||||
static public function GetName()
|
||||
{
|
||||
return 'Generic RO test on '.self::GetConfigFile();
|
||||
}
|
||||
|
||||
static public function GetConfigFile() {return '/config-test-itopv06.php';}
|
||||
}
|
||||
|
||||
class TestUserRightsMatrixItop extends TestUserRights
|
||||
{
|
||||
static public function GetName()
|
||||
@@ -2149,52 +2067,6 @@ class TestSetLinkset extends TestBizModel
|
||||
}
|
||||
}
|
||||
|
||||
class TestEmailAsynchronous extends TestBizModel
|
||||
{
|
||||
static public function GetName()
|
||||
{
|
||||
return 'Itop - Asynchronous email';
|
||||
}
|
||||
|
||||
static public function GetDescription()
|
||||
{
|
||||
return 'Queues a request to send an email';
|
||||
}
|
||||
|
||||
protected function DoExecute()
|
||||
{
|
||||
for ($i = 0 ; $i < 2 ; $i++)
|
||||
{
|
||||
$oMail = new Email();
|
||||
$oMail->SetRecipientTO('romain.quetiez@combodo.com');
|
||||
$oMail->SetRecipientFrom('romain.quetiez@combodo.com');
|
||||
$oMail->SetRecipientCC('romainquetiez@yahoo.fr');
|
||||
$oMail->SetSubject('automated test - '.$i);
|
||||
$oMail->SetBody('this is one is entirely working fine '.time());
|
||||
$iRes = $oMail->Send($aIssues, false);
|
||||
switch ($iRes)
|
||||
{
|
||||
case EMAIL_SEND_OK:
|
||||
echo "EMAIL_SEND_OK<br/>\n";
|
||||
break;
|
||||
|
||||
case EMAIL_SEND_PENDING:
|
||||
echo "EMAIL_SEND_PENDING<br/>\n";
|
||||
break;
|
||||
|
||||
case EMAIL_SEND_ERROR:
|
||||
echo "EMAIL_SEND_ERROR: <br/>\n";
|
||||
foreach($aIssues as $sIssue)
|
||||
{
|
||||
echo "Issue: $sIssue<br/>\n";
|
||||
}
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
abstract class TestLinkSet extends TestBizModel
|
||||
{
|
||||
protected function StandardizedDump($oSet, $sAttPrefixToIgnore)
|
||||
|
||||
Reference in New Issue
Block a user