Skip to content

Commit

Permalink
Merge pull request #17 from k00ni/patch-2
Browse files Browse the repository at this point in the history
UtilTest.php: two new tests to check reaction of getLiteralLanguage and getLiteralValue if non-literal was given
  • Loading branch information
pietercolpaert authored Nov 27, 2017
2 parents bde96bb + f1a3820 commit 21e29b0
Showing 1 changed file with 17 additions and 1 deletion.
18 changes: 17 additions & 1 deletion test/UtilTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -119,6 +119,14 @@ public function testGetLiteralValue () {
//it('does not work with null', function () {
//TODO: Util::getLiteralValue.bind(null, null).should.throw('null is not a literal');
}

// tests reaction if no literal was given
public function testGetLiteralValueNoLiteralGiven()
{
$this->expectException('\Exception');

Util::getLiteralValue('invalid');
}

public function testGetLiteralType () {
//it('gets the type of a literal', function () {
Expand Down Expand Up @@ -212,6 +220,14 @@ public function testGetLiteralLanguageMultilineString()
$this->assertEquals('en', Util::getLiteralLanguage($literal));
}

// tests reaction if no language was given
public function testGetLiteralLanguageNoLiteralGiven()
{
$this->expectException('\Exception');

Util::getLiteralLanguage('invalid');
}

public function testIsPrefixedName () {
//it('matches a prefixed name', function () {
$this->assertEquals(true,Util::isPrefixedName('ex:Test'));
Expand Down Expand Up @@ -373,4 +389,4 @@ public function testthe function () {
}
*/
}


0 comments on commit 21e29b0

Please sign in to comment.