From 632169aae50e3ec1441cc6b277804350b05e10a9 Mon Sep 17 00:00:00 2001 From: Henri Ylikotila Date: Tue, 19 Dec 2017 13:22:49 +0200 Subject: [PATCH] fixing the unit tests --- tests/ConceptPropertyValueLiteralTest.php | 18 ++++++++++++------ 1 file changed, 12 insertions(+), 6 deletions(-) diff --git a/tests/ConceptPropertyValueLiteralTest.php b/tests/ConceptPropertyValueLiteralTest.php index 5591a9dc1..f801c2c08 100644 --- a/tests/ConceptPropertyValueLiteralTest.php +++ b/tests/ConceptPropertyValueLiteralTest.php @@ -25,7 +25,8 @@ protected function setUp() { */ public function testConstructor() { $litmock = $this->getMockBuilder('EasyRdf\Literal')->disableOriginalConstructor()->getMock(); - $prop = new ConceptPropertyValueLiteral($litmock, 'skosmos:someProperty'); + $resmock = $this->getMockBuilder('EasyRdf\Resource')->disableOriginalConstructor()->getMock(); + $prop = new ConceptPropertyValueLiteral($this->model, $this->vocab, $resmock, $litmock, 'skosmos:someProperty'); $this->assertEquals(null, $prop->__toString()); } @@ -101,7 +102,8 @@ public function testToString() { */ public function testToStringEmpty() { $litmock = $this->getMockBuilder('EasyRdf\Literal')->disableOriginalConstructor()->getMock(); - $lit = new ConceptPropertyValueLiteral($litmock, 'skosmos:testType'); + $resmock = $this->getMockBuilder('EasyRdf\Resource')->disableOriginalConstructor()->getMock(); + $lit = new ConceptPropertyValueLiteral($this->model, $this->vocab, $resmock, $litmock, 'skosmos:testType'); $this->assertEquals('', $lit); } @@ -110,7 +112,8 @@ public function testToStringEmpty() { */ public function testGetNotation() { $litmock = $this->getMockBuilder('EasyRdf\Literal')->disableOriginalConstructor()->getMock(); - $lit = new ConceptPropertyValueLiteral($litmock, 'skosmos:testType'); + $resmock = $this->getMockBuilder('EasyRdf\Resource')->disableOriginalConstructor()->getMock(); + $lit = new ConceptPropertyValueLiteral($this->model, $this->vocab, $resmock, $litmock, 'skosmos:testType'); $this->assertEquals(null, $lit->getNotation()); } @@ -120,7 +123,8 @@ public function testGetNotation() { public function testGetContainsHtmlWhenThereIsNone() { $litmock = $this->getMockBuilder('EasyRdf\Literal')->disableOriginalConstructor()->getMock(); $litmock->method('getValue')->will($this->returnValue('a regular literal')); - $lit = new ConceptPropertyValueLiteral($litmock, 'skosmos:testType'); + $resmock = $this->getMockBuilder('EasyRdf\Resource')->disableOriginalConstructor()->getMock(); + $lit = new ConceptPropertyValueLiteral($this->model, $this->vocab, $resmock, $litmock, 'skosmos:testType'); $this->assertFalse($lit->getContainsHtml()); } @@ -130,7 +134,8 @@ public function testGetContainsHtmlWhenThereIsNone() { public function testGetContainsHtmlWhenThereIsOnlyAOpeningTag() { $litmock = $this->getMockBuilder('EasyRdf\Literal')->disableOriginalConstructor()->getMock(); $litmock->method('getValue')->will($this->returnValue('a literal with broken html')); - $lit = new ConceptPropertyValueLiteral($litmock, 'skosmos:testType'); + $resmock = $this->getMockBuilder('EasyRdf\Resource')->disableOriginalConstructor()->getMock(); + $lit = new ConceptPropertyValueLiteral($this->model, $this->vocab, $resmock, $litmock, 'skosmos:testType'); $this->assertFalse($lit->getContainsHtml()); } @@ -140,7 +145,8 @@ public function testGetContainsHtmlWhenThereIsOnlyAOpeningTag() { public function testGetContainsHtml() { $litmock = $this->getMockBuilder('EasyRdf\Literal')->disableOriginalConstructor()->getMock(); $litmock->method('getValue')->will($this->returnValue('a literal with valid html')); - $lit = new ConceptPropertyValueLiteral($litmock, 'skosmos:testType'); + $resmock = $this->getMockBuilder('EasyRdf\Resource')->disableOriginalConstructor()->getMock(); + $lit = new ConceptPropertyValueLiteral($this->model, $this->vocab, $resmock, $litmock, 'skosmos:testType'); $this->assertTrue($lit->getContainsHtml()); } }