Skip to content

Commit

Permalink
Added minor tests
Browse files Browse the repository at this point in the history
  • Loading branch information
jkphl committed Feb 11, 2017
1 parent 76f1b60 commit bc4afcd
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 1 deletion.
13 changes: 12 additions & 1 deletion src/Rdfalite/Tests/ThingTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -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
*
Expand Down Expand Up @@ -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);

Expand Down
1 change: 1 addition & 0 deletions src/Rdfalite/Tests/VocabularyTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -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'));
}

/**
Expand Down

0 comments on commit bc4afcd

Please sign in to comment.