Add retriever to CloudObject and allow retrieval of related objects
This commit is contained in:
@@ -43,7 +43,7 @@ class ObjectRetrieverMockTest extends \PHPUnit\Framework\TestCase {
|
||||
// Test CloudObject interface
|
||||
$object = $this->retriever->getCloudObject($coid);
|
||||
$this->assertNotNull($object);
|
||||
$this->assertEquals((string)$coid, $object->getObjectNode()->getID());
|
||||
$this->assertEquals((string)$coid, $object->getObjectNode()->getId());
|
||||
$this->assertEquals($coid, $object->getCOID());
|
||||
$this->assertNotNull($object->getString('http://www.w3.org/2000/01/rdf-schema#label'));
|
||||
$this->assertEquals('CloudObjects', $object->getString('http://www.w3.org/2000/01/rdf-schema#label'));
|
||||
|
||||
@@ -28,9 +28,21 @@ class ObjectRetrieverPublicTest extends \PHPUnit\Framework\TestCase {
|
||||
$coid = new IRI('coid://cloudobjects.io');
|
||||
$object = $this->retriever->getObjectNode($coid);
|
||||
$this->assertNotNull($object);
|
||||
$this->assertEquals((string)$coid, $object->getID());
|
||||
$this->assertEquals((string)$coid, $object->getId());
|
||||
$this->assertNotNull($object->getProperty('http://www.w3.org/2000/01/rdf-schema#label'));
|
||||
$this->assertEquals('CloudObjects', $object->getProperty('http://www.w3.org/2000/01/rdf-schema#label')->getValue());
|
||||
$this->assertEquals('CloudObjects', $object->getProperty('http://www.w3.org/2000/01/rdf-schema#label')->getValue());
|
||||
}
|
||||
|
||||
public function testGetRelatedObject() {
|
||||
$coid = new IRI('coid://cloudobjects.io');
|
||||
$object = $this->retriever->getCloudObject($coid);
|
||||
$this->assertNotNull($object);
|
||||
$this->assertNotNull($object->getIRI('coid://cloudobjects.io/isVisibleTo'));
|
||||
$this->assertEquals('coid://cloudobjects.io/Public', $object->getString('coid://cloudobjects.io/isVisibleTo'));
|
||||
|
||||
$relatedObject = $object->getCloudObject('coid://cloudobjects.io/isVisibleTo');
|
||||
$this->assertNotNull($relatedObject);
|
||||
$this->assertEquals('coid://cloudobjects.io/Public', (string)$relatedObject->getCOID());
|
||||
}
|
||||
|
||||
public function testGetCOIDList() {
|
||||
|
||||
Reference in New Issue
Block a user