Esempio n. 1
0
/**
 * Get the parent of a specific node.
 *
 * @param string $uuid Unique identifier for a node.
 * @return object|bool An object representing the parent node or False.
 */
    function get_parent($uuid) {
        if (ELIS_FILES_DEBUG_TRACE) mtrace('get_parent(' . $uuid . ')');

        if (!$this->get_defaults()) {
            return false;
        }

        if (self::is_version('3.2')) {
            return elis_files_get_parent($uuid);
        } else if (self::is_version('3.4')) {
            if ($uuid == $this->root->uuid) {
                // At the top level, so there is no parent
                return false;
            }

            if (!$node = $this->cmis->getFolderParent('workspace://SpacesStore/' . $uuid)) {
                return false;
            }

            $type = '';
            return elis_files_process_node_new($node, $type);
        }
    }
Esempio n. 2
0
    /**
     * Test the elis_files_process_node_new function with objectid property.
     * @dataProvider node_new_properties_provider
     * @param string $field a node property
     * @param string $data a node property value
     */
    public function test_process_node_new_noderef($field, $data) {
        $node = $this->setup_node();
        // test the 3 different owners
        $node->properties[$field] = $data;

        $contentnode = elis_files_process_node_new($node, $type);

        $expectedcontentnode = $this->setup_expected_content($node);

        $this->assertEquals($data, $contentnode->noderef);

    }