diff --git a/src/Rdfalite/Tests/ThingTest.php b/src/Rdfalite/Tests/ThingTest.php index 143bbb7..08a7282 100644 --- a/src/Rdfalite/Tests/ThingTest.php +++ b/src/Rdfalite/Tests/ThingTest.php @@ -79,6 +79,16 @@ public function testMinimumThing() $this->assertEquals(0, count($thing->getProperties())); } + /** + * Test the resource ID + */ + public function testResourceId() + { + $thing = new Thing('Person', self::$schemaOrgVocabulary, 'bob'); + $this->assertInstanceOf(Thing::class, $thing); + $this->assertEquals('bob', $thing->getId()); + } + /** * Test the thing instantiation with an invalid type * @@ -143,7 +153,8 @@ public function testGetInvalidPropertyName() /** * Test adding children */ - public function testAddChild() { + public function testAddChild() + { $thing = new Thing('Person', self::$schemaOrgVocabulary); $this->assertInstanceOf(Thing::class, $thing); diff --git a/src/Rdfalite/Tests/VocabularyTest.php b/src/Rdfalite/Tests/VocabularyTest.php index ff16b03..b446128 100644 --- a/src/Rdfalite/Tests/VocabularyTest.php +++ b/src/Rdfalite/Tests/VocabularyTest.php @@ -61,6 +61,7 @@ public function testVocabulary() $vocabulary = new Vocabulary(self::SCHEMA_ORG); $this->assertInstanceOf(Vocabulary::class, $vocabulary); $this->assertEquals(self::SCHEMA_ORG, $vocabulary->getUrl()); + $this->assertEquals(self::SCHEMA_ORG.'/Person', $vocabulary->expand('Person')); } /**