4use PHPUnit\Framework\TestCase;
 
   13    protected function setUp() : void
 
   15        include_once(
"./Services/PHPUnit/classes/class.ilUnitUtil.php");
 
   16        ilUnitUtil::performInitialisation();
 
   30        $obj2->setType(
"xxx");
 
   32        $id2 = $obj2->getId();
 
   34        if ($id2 == ($id + 1)) {
 
   50        $this->assertEquals(
"create1-create2-create3-", $value);
 
   64        $obj->setTitle(
"TestObject");
 
   65        $obj->setDescription(
"TestDescription");
 
   66        $obj->setImportId(
"imp_44");
 
   68        $obj->createReference();
 
   70        $ref_id = $obj->getRefId();
 
   73        if ($obj->getType() == 
"") {
 
   76        if ($obj->getTitle() == 
"TestObject") {
 
   79        if ($obj->getDescription() == 
"TestDescription") {
 
   82        if ($obj->getImportId() == 
"imp_44") {
 
   85        if ($obj->getOwner() == 
$ilUser->getId()) {
 
   90        if ($obj->getTitle() == 
"TestObject") {
 
   94        if ($obj->getCreateDate() == ($lu = $obj->getLastUpdateDate())) {
 
   97        $obj->setTitle(
"TestObject2");
 
  102        if ($lu != ($lu2 = $obj->getLastUpdateDate())) {
 
  105        if ($obj->getTitle() == 
"TestObject2") {
 
  136        if (is_array($ar) && count($ar) == 1 && $ar[$ref_id] == $ref_id) {
 
  141        foreach ($ids as 
$i) {
 
  148        foreach ($obs as $ob) {
 
  149            if ($ob[
"obj_id"] == 
$ilUser->getId()) {
 
  159        if ($d1 != $d2 && $d1 == $d3 && $d3 == 
null) {
 
  165        $this->assertEquals(
"sg1-sg2-sg3-sg4-sg5-sg6-sg7-up1-up2-" .
 
  166            "lu1-lu2-lu3-lu4-lu5-lu6-lu7-lu8-lu9-lu10-lu11-dd1-", $value);
 
  175        $tree = 
$DIC->repositoryTree();
 
  176        $user = 
$DIC->user();
 
  179        $obj->setType(
"xxx");
 
  180        $obj->setTitle(
"TestObject");
 
  181        $obj->setDescription(
"TestDescription");
 
  182        $obj->setImportId(
"imp_44");
 
  184        $obj->createReference();
 
  186        $ref_id = $obj->getRefId();
 
  191        if ($tree->isInTree($ref_id)) {
 
  199        $tree->useCache(
false);
 
  200        $tree->moveToTrash($ref_id, 
true, $user->getId());
 
  201        if ($tree->isDeleted($ref_id)) {
 
  204        if ($tree->isSaved($ref_id)) {
 
  214        $saved_tree = 
new ilTree(-(
int) $ref_id);
 
  215        $node_data = $saved_tree->getNodeData($ref_id);
 
  216        $saved_tree->deleteTree($node_data);
 
  223        foreach ($obs as $ob) {
 
  231        $this->assertEquals(
"tree1-tree2-tree3-tree4-tree5-tree6-tree7-", $value);
 
  241        $user = 
$DIC->user();
 
  248        $this->assertEquals($date, 
null);
 
An exception for terminatinating execution or to throw for unit testing.
@group needsInstalledILIAS
testCreationDeletion()
@group IL_Init
testSetGetLookup()
@group IL_Init
testTreeTrash()
@group IL_Init
testObjectReference()
test object reference queries @group IL_Init
Class ilObject Basic functions for all objects.
static _lookupOwnerName($a_owner_id)
lookup owner name for owner id
static _lookupObjId($a_id)
static _resetDeletedDate($a_ref_id)
only called in ilObjectGUI::insertSavedNodes
static _lookupTitle($a_id)
lookup object title
static _lookupObjectId($a_ref_id)
lookup object id
static _getObjectsByType($a_obj_type="", $a_owner="")
Get objects by type.
static _lookupDescription($a_id)
lookup object description
static _getAllReferences($a_id)
get all reference ids of object
static _exists($a_id, $a_reference=false, $a_type=null)
checks if an object exists in object_data@access public
static _hasUntrashedReference($a_obj_id)
checks wether an object has at least one reference that is not in trash
static _lookupObjIdByImportId($a_import_id)
static _setDeletedDate($a_ref_id, $a_deleted_by)
static _lookupDeletedDate($a_ref_id)
only called in ilObjectGUI::insertSavedNodes
static _lookupLastUpdate($a_id, $a_as_string=false)
lookup last update
static _lookupOwner($a_id)
lookup object owner
static _isInTrash($a_ref_id)
checks wether object is in trash
static _lookupType($a_id, $a_reference=false)
lookup object type
static _getIdsForTitle($title, $type='', $partialmatch=false)
Tree class data representation in hierachical trees using the Nested Set Model with Gaps by Joe Celco...
static _getObjectsByOperations($a_obj_type, $a_operation, $a_usr_id=0, $limit=0)
Get all objects of a specific type and check access This function is not recursive,...