// /** * Created by PhpStorm. * User: Eric * Date: 02/10/2017 * Time: 13:58 */ namespace Combodo\iTop\Test\UnitTest\Core; use Combodo\iTop\Test\UnitTest\ItopDataTestCase; use DBObject; use MetaModel; /** * @group specificOrgInSampleData */ class XMLDataLoaderTest extends ItopDataTestCase { public const CREATE_TEST_ORG = false; public function testDataLoader() { $sXML = << ZuperTest active 0 no 0 ZuperTest no Zanzibar active 71 ZuperTest ZuperTest no
Zanzibar no
Zmillpatt active 71 ZuperTest ZuperTest no yes Zacharie 4 Zanzibar Zanzibar no 0 no Person Zacharie Zmillpatt no Contact updated GUI:Console class restriction: Contact allow_no_channel Contact SELECT `Person` FROM Person AS `Person` WHERE ((`status` = 'active') AND ((`org_id` = :current_contact->org_id) OR (`org_id` = :this->org_id))) email,name TriggerOnObjectUpdate Contact updated
XML; $this->CreateFromXMLString($sXML); $oPerson = MetaModel::GetObjectByName('Person', 'Zacharie Zmillpatt'); $oTrigger = MetaModel::GetObjectByName('TriggerOnObjectUpdate', 'Contact updated'); $this->assertEquals('Zanzibar', $oPerson->Get('location_id_friendlyname')); $this->assertEquals('ZuperTest', $oPerson->Get('org_id_friendlyname')); $this->assertEquals('email, name', (string)$oTrigger->Get('target_attcodes')); // should add space after comma } }