From bc4afcd5fcc6363b661beb0f3d431ce7683cc88a Mon Sep 17 00:00:00 2001 From: Joschi Kuphal Date: Sat, 11 Feb 2017 23:17:00 +0100 Subject: [PATCH] Added minor tests --- src/Rdfalite/Tests/ThingTest.php | 13 ++++++++++++- src/Rdfalite/Tests/VocabularyTest.php | 1 + 2 files changed, 13 insertions(+), 1 deletion(-) 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')); } /**