コード例 #1
0
 public static function setUpBeforeClass()
 {
     // add sample data
     usePreparedInsertBlade('Dictionary', array('chapter_id' => 1, 'dict_value' => 'unit test object type a'));
     self::$objtypea_id = lastInsertID();
     usePreparedInsertBlade('Dictionary', array('chapter_id' => 1, 'dict_value' => 'unit test object type b'));
     self::$objtypeb_id = lastInsertID();
     usePreparedInsertBlade('Dictionary', array('chapter_id' => 1, 'dict_value' => 'unit test object type c'));
     self::$objtypec_id = lastInsertID();
     usePreparedInsertBlade('Dictionary', array('chapter_id' => 1, 'dict_value' => 'unit test object type d'));
     self::$objtyped_id = lastInsertID();
     commitSupplementOPC(self::$objtypea_id, self::$objtypeb_id);
     commitSupplementOPC(self::$objtypea_id, self::$objtypec_id);
     commitSupplementOPC(self::$objtypeb_id, self::$objtypea_id);
     commitSupplementOPC(self::$objtypeb_id, self::$objtypec_id);
     commitSupplementOPC(self::$objtypec_id, self::$objtypea_id);
     commitSupplementOPC(self::$objtypec_id, self::$objtypeb_id);
     self::$objecta_id = commitAddObject('unit test object a', NULL, self::$objtypea_id, NULL);
     self::$objectb_id = commitAddObject('unit test object b', NULL, self::$objtypeb_id, NULL);
     self::$objectc_id = commitAddObject('unit test object c', NULL, self::$objtypec_id, NULL);
     self::$objectd_id = commitAddObject('unit test object d', NULL, self::$objtyped_id, NULL);
     self::$locationa_id = commitAddObject('unit test location a', NULL, 1562, NULL);
     self::$locationb_id = commitAddObject('unit test location b', NULL, 1562, NULL);
     self::$locationc_id = commitAddObject('unit test location c', NULL, 1562, NULL);
     self::$rowa_id = commitAddObject('unit test row a', NULL, 1561, NULL);
     self::$rowb_id = commitAddObject('unit test row b', NULL, 1561, NULL);
     self::$racka_id = commitAddObject('unit test rack a', NULL, 1560, NULL);
     self::$rackb_id = commitAddObject('unit test rack b', NULL, 1560, NULL);
 }
コード例 #2
0
 public static function setUpBeforeClass()
 {
     // add sample locations
     self::$first_location_id = $parent_location_id = commitAddObject('unit test location 0', NULL, 1562, NULL);
     for ($i = 1; $i <= self::$num_children; $i++) {
         $child_location_id = commitAddObject("unit test location {$i}", NULL, 1562, NULL);
         commitLinkEntities('location', $parent_location_id, 'location', $child_location_id);
         $parent_location_id = $child_location_id;
     }
     self::$last_location_id = $parent_location_id;
     // add sample objects
     usePreparedInsertBlade('Dictionary', array('chapter_id' => 1, 'dict_value' => 'unit test object type'));
     self::$objtype_id = lastInsertID();
     commitSupplementOPC(self::$objtype_id, self::$objtype_id);
     self::$first_object_id = $parent_object_id = commitAddObject('unit test object 0', NULL, self::$objtype_id, NULL);
     for ($i = 1; $i <= self::$num_children; $i++) {
         $child_object_id = commitAddObject("unit test object {$i}", NULL, self::$objtype_id, NULL);
         commitLinkEntities('object', $parent_object_id, 'object', $child_object_id);
         $parent_object_id = $child_object_id;
     }
     self::$last_object_id = $parent_object_id;
     // add sample tags
     usePreparedInsertBlade('TagTree', array('tag' => 'unit test tag 0'));
     self::$first_tag_id = $parent_tag_id = lastInsertID();
     for ($i = 1; $i <= self::$num_children; $i++) {
         usePreparedInsertBlade('TagTree', array('parent_id' => $parent_tag_id, 'tag' => "unit test tag {$i}"));
         $parent_tag_id = lastInsertID();
     }
     self::$last_tag_id = $parent_tag_id;
 }