diff --git a/.travis.yml b/.travis.yml index 86c7dc589..9a9b50b64 100644 --- a/.travis.yml +++ b/.travis.yml @@ -2,7 +2,6 @@ sudo: required dist: trusty language: php php: - - 7.1 - 7.2 - 7.3 - 7.4 @@ -35,6 +34,5 @@ env: matrix: exclude: allow_failures: - - php: 7.4 notifications: slack: kansalliskirjasto:9mOKu3Vws1CIddF5jqWgXbli diff --git a/composer.json b/composer.json index 13fdcb566..2354c2830 100644 --- a/composer.json +++ b/composer.json @@ -80,7 +80,7 @@ "grimmlink/qtip2": "3.0.3" }, "require-dev": { - "phpunit/phpunit": "7.2.0 - 7.5.20", + "phpunit/phpunit": "8.5.*", "umpirsky/twig-gettext-extractor": "1.3.*", "symfony/dom-crawler": "3.4.3", "mockery/mockery": "1.3.1" diff --git a/model/DataObject.php b/model/DataObject.php index eded68410..a1359758d 100644 --- a/model/DataObject.php +++ b/model/DataObject.php @@ -27,7 +27,7 @@ class DataObject public function __construct($model, $resource) { if (!($model instanceof Model) || !($resource instanceof EasyRdf\Resource)) { - throw new Exception('Invalid constructor parameter given to DataObject.'); + throw new InvalidArgumentException('Invalid constructor parameter given to DataObject.'); } $this->model = $model; diff --git a/model/Model.php b/model/Model.php index 3c15f365b..a3cc27383 100644 --- a/model/Model.php +++ b/model/Model.php @@ -417,7 +417,7 @@ public function getVocabulary($vocid): Vocabulary return $voc; } } - throw new Exception("Vocabulary id '$vocid' not found in configuration."); + throw new ValueError("Vocabulary id '$vocid' not found in configuration."); } /** @@ -444,7 +444,7 @@ public function getVocabularyByGraph($graph, $endpoint = null) if (array_key_exists($key, $this->vocabsByGraph)) { return $this->vocabsByGraph[$key]; } else { - throw new Exception("no vocabulary found for graph $graph and endpoint $endpoint"); + throw new ValueError("no vocabulary found for graph $graph and endpoint $endpoint"); } } diff --git a/model/VocabularyCategory.php b/model/VocabularyCategory.php index aa80324af..1ef97397f 100644 --- a/model/VocabularyCategory.php +++ b/model/VocabularyCategory.php @@ -8,7 +8,7 @@ class VocabularyCategory extends DataObject public function __construct($model, $resource) { if (!($model instanceof Model)) { - throw new Exception('Invalid constructor parameter given to DataObject.'); + throw new InvalidArgumentException('Invalid constructor parameter given to DataObject.'); } $this->model = $model; diff --git a/model/sparql/GenericSparql.php b/model/sparql/GenericSparql.php index cedeeb1d9..c302b70b8 100644 --- a/model/sparql/GenericSparql.php +++ b/model/sparql/GenericSparql.php @@ -467,7 +467,11 @@ private function transformConceptInfoResults($result, $uris, $vocabs, $clang) { $conceptArray = array(); foreach ($uris as $index => $uri) { $conc = $result->resource($uri); - $vocab = (isset($vocabs) && sizeof($vocabs) == 1) ? $vocabs[0] : $vocabs[$index]; + if (is_array($vocabs)) { + $vocab = (sizeof($vocabs) == 1) ? $vocabs[0] : $vocabs[$index]; + } else { + $vocab = null; + } $conceptArray[] = new Concept($this->model, $vocab, $conc, $result, $clang); } return $conceptArray; diff --git a/tests/ConceptMappingPropertyValueTest.php b/tests/ConceptMappingPropertyValueTest.php index 022f58924..11377191e 100644 --- a/tests/ConceptMappingPropertyValueTest.php +++ b/tests/ConceptMappingPropertyValueTest.php @@ -7,7 +7,8 @@ class ConceptMappingPropertyValueTest extends PHPUnit\Framework\TestCase private $vocab; private $props; - protected function setUp() { + protected function setUp() : void + { putenv("LANGUAGE=en_GB.utf8"); putenv("LC_ALL=en_GB.utf8"); setlocale(LC_ALL, 'en_GB.utf8'); diff --git a/tests/ConceptPropertyTest.php b/tests/ConceptPropertyTest.php index fe2ac300b..b9b55a0c2 100644 --- a/tests/ConceptPropertyTest.php +++ b/tests/ConceptPropertyTest.php @@ -4,7 +4,8 @@ class ConceptPropertyTest extends PHPUnit\Framework\TestCase { private $model; - protected function setUp() { + protected function setUp() : void + { putenv("LANGUAGE=en_GB.utf8"); putenv("LC_ALL=en_GB.utf8"); setlocale(LC_ALL, 'en_GB.utf8'); diff --git a/tests/ConceptPropertyValueLiteralTest.php b/tests/ConceptPropertyValueLiteralTest.php index fa8ca5d1b..9108b4c7a 100644 --- a/tests/ConceptPropertyValueLiteralTest.php +++ b/tests/ConceptPropertyValueLiteralTest.php @@ -6,7 +6,8 @@ class ConceptPropertyValueLiteralTest extends PHPUnit\Framework\TestCase private $concept; private $vocab; - protected function setUp() { + protected function setUp() : void + { putenv("LANGUAGE=en_GB.utf8"); putenv("LC_ALL=en_GB.utf8"); setlocale(LC_ALL, 'en_GB.utf8'); @@ -47,14 +48,14 @@ public function testGetLabelThatIsADate() { $concepts = $vocab->getConceptInfo("http://www.skosmos.skos/date/d1", "en"); $props = $concepts[0]->getProperties(); $propvals = $props['http://www.skosmos.skos/date/ownDate']->getValues(); - $this->assertContains('8/8/15', $propvals['8/8/15']->getLabel()); + $this->assertStringContainsString('8/8/15', $propvals['8/8/15']->getLabel()); } /** * @covers ConceptPropertyValueLiteral::getLabel - * @expectedException PHPUnit\Framework\Error\Warning */ public function testGetLabelThatIsABrokenDate() { + $this->expectWarning(); $vocab = $this->model->getVocabulary('dates'); $concepts = $vocab->getConceptInfo("http://www.skosmos.skos/date/d2", "en"); $props = $concepts[0]->getProperties(); diff --git a/tests/ConceptPropertyValueTest.php b/tests/ConceptPropertyValueTest.php index cf0eccb61..6c133e26d 100644 --- a/tests/ConceptPropertyValueTest.php +++ b/tests/ConceptPropertyValueTest.php @@ -6,7 +6,8 @@ class ConceptPropertyValueTest extends PHPUnit\Framework\TestCase private $concept; private $vocab; - protected function setUp() { + protected function setUp() : void + { putenv("LANGUAGE=en_GB.utf8"); putenv("LC_ALL=en_GB.utf8"); setlocale(LC_ALL, 'en_GB.utf8'); diff --git a/tests/ConceptSearchParametersTest.php b/tests/ConceptSearchParametersTest.php index f6c70694a..dab94397c 100644 --- a/tests/ConceptSearchParametersTest.php +++ b/tests/ConceptSearchParametersTest.php @@ -5,7 +5,8 @@ class ConceptSearchParametersTest extends PHPUnit\Framework\TestCase private $model; private $request; - protected function setUp() { + protected function setUp() : void + { putenv("LANGUAGE=en_GB.utf8"); putenv("LC_ALL=en_GB.utf8"); setlocale(LC_ALL, 'en_GB.utf8'); @@ -13,7 +14,8 @@ protected function setUp() { $this->model = new Model(new GlobalConfig('/../tests/testconfig.ttl')); } - protected function tearDown() { + protected function tearDown() : void + { $this->params = null; } diff --git a/tests/ConceptTest.php b/tests/ConceptTest.php index 4a1472d81..0885da8d3 100644 --- a/tests/ConceptTest.php +++ b/tests/ConceptTest.php @@ -10,7 +10,8 @@ class ConceptTest extends PHPUnit\Framework\TestCase private $cbdVocab; private $cbdGraph; - protected function setUp() { + protected function setUp() : void + { putenv("LANGUAGE=en_GB.utf8"); putenv("LC_ALL=en_GB.utf8"); setlocale(LC_ALL, 'en_GB.utf8'); @@ -283,7 +284,7 @@ public function testGetTimestamp() { $concepts = $vocab->getConceptInfo("http://www.skosmos.skos/test/ta123", "en"); $concept = $concepts[0]; $date = $concept->getDate(); - $this->assertContains('10/1/14', $date); + $this->assertStringContainsString('10/1/14', $date); } /** @@ -294,8 +295,8 @@ public function testGetDateWithCreatedAndModified() { $concepts = $vocab->getConceptInfo("http://www.skosmos.skos/date/d1", "en"); $concept = $concepts[0]; $date = $concept->getDate(); - $this->assertContains('1/3/00', $date); - $this->assertContains('6/6/12', $date); + $this->assertStringContainsString('1/3/00', $date); + $this->assertStringContainsString('6/6/12', $date); } /** @@ -323,7 +324,7 @@ public function testGetTimestampInvalidResult() { $concept = $concepts[0]; # we use @ to suppress the exceptions in order to be able to check the result $date = @$concept->getDate(); - $this->assertContains('1986-21-00', $date); + $this->assertStringContainsString('1986-21-00', $date); } /** @@ -583,9 +584,9 @@ public function testProcessExternalResource() { $concept->processExternalResource($res); $json = $concept->dumpJsonLd(); - $this->assertContains('HY', $json); - $this->assertContains('AK', $json); - $this->assertContains('OS', $json); + $this->assertStringContainsString('HY', $json); + $this->assertStringContainsString('AK', $json); + $this->assertStringContainsString('OS', $json); $contains_count = substr_count($json, "CONTAINS"); $this->assertEquals($contains_count, 3); } diff --git a/tests/DataObjectTest.php b/tests/DataObjectTest.php index d98010371..b87644513 100644 --- a/tests/DataObjectTest.php +++ b/tests/DataObjectTest.php @@ -7,11 +7,11 @@ class DataObjectTest extends PHPUnit\Framework\TestCase /** * @covers DataObject::__construct * @uses DataObject - * @expectedException \Exception - * @expectedExceptionMessage Invalid constructor parameter given to DataObject. */ public function testConstructorNoArguments() { + $this->expectException(InvalidArgumentException::class); + $this->expectExceptionMessage("Invalid constructor parameter given to DataObject"); $obj = new DataObject(null, null); $this->assertNotNull($obj); } diff --git a/tests/FeedbackTest.php b/tests/FeedbackTest.php index 0b2925440..bf4a5d5f6 100644 --- a/tests/FeedbackTest.php +++ b/tests/FeedbackTest.php @@ -7,7 +7,8 @@ class FeedbackTest extends PHPUnit\Framework\TestCase private $model; private $request; - protected function setUp() { + protected function setUp() : void + { $config = new GlobalConfig('/../tests/testconfig-fordefaults.ttl'); $this->model = new Model($config); $this->request = \Mockery::mock('Request', array($this->model))->makePartial(); diff --git a/tests/GenericSparqlTest.php b/tests/GenericSparqlTest.php index e63979917..864051fa1 100644 --- a/tests/GenericSparqlTest.php +++ b/tests/GenericSparqlTest.php @@ -8,7 +8,8 @@ class GenericSparqlTest extends PHPUnit\Framework\TestCase private $vocab; private $params; - protected function setUp() { + protected function setUp() : void + { putenv("LANGUAGE=en_GB.utf8"); putenv("LC_ALL=en_GB.utf8"); setlocale(LC_ALL, 'en_GB.utf8'); @@ -365,7 +366,7 @@ public function testQueryConceptsAlphabeticalSpecialChars() { public function testQueryConceptsAlphabeticalNumbers() { $actual = $this->sparql->queryConceptsAlphabetical('0-9', 'en'); $this->assertEquals(1, sizeof($actual)); - $this->assertContains("3D", $actual[0]['prefLabel']); + $this->assertStringContainsString("3D", $actual[0]['prefLabel']); } /** @@ -731,7 +732,7 @@ public function testQueryConceptsAsteriskBeforeTerm() $actual = $this->sparql->queryConcepts(array($voc), null, null, $this->params); $this->assertEquals(3, sizeof($actual)); foreach($actual as $match) - $this->assertContains('bass', $match['prefLabel'], '',true); + $this->assertStringContainsStringIgnoringCase('bass', $match['prefLabel']); } /** @@ -750,7 +751,7 @@ public function testQueryConceptsAsteriskBeforeAndAfterTerm() $actual = $this->sparql->queryConcepts(array($voc), null, null, $this->params); $this->assertEquals(3, sizeof($actual)); foreach($actual as $match) - $this->assertContains('bass', $match['prefLabel'], '',true); + $this->assertStringContainsStringIgnoringCase('bass', $match['prefLabel']); } /** diff --git a/tests/GlobalConfigTest.php b/tests/GlobalConfigTest.php index 4db3dda82..a33fa2c3a 100644 --- a/tests/GlobalConfigTest.php +++ b/tests/GlobalConfigTest.php @@ -11,7 +11,7 @@ class GlobalConfigTest extends PHPUnit\Framework\TestCase /** @var GlobalConfig */ private $configWithDefaults; - protected function setUp() + protected function setUp() : void { $this->config = new GlobalConfig('/../tests/testconfig.ttl'); $this->assertNotNull($this->config->getCache()); diff --git a/tests/Http304Test.php b/tests/Http304Test.php index f3d683b59..cbeafe1b0 100644 --- a/tests/Http304Test.php +++ b/tests/Http304Test.php @@ -230,7 +230,7 @@ public function testHttp304() $this->assertEquals("", $content); } - public function tearDown() + public function tearDown() : void { parent::tearDown(); \Mockery::close(); diff --git a/tests/JenaTextSparqlTest.php b/tests/JenaTextSparqlTest.php index e995bc54c..525062e06 100644 --- a/tests/JenaTextSparqlTest.php +++ b/tests/JenaTextSparqlTest.php @@ -8,7 +8,8 @@ class JenaTextSparqlTest extends PHPUnit\Framework\TestCase private $vocab; private $params; - protected function setUp() { + protected function setUp() : void + { putenv("LANGUAGE=en_GB.utf8"); putenv("LC_ALL=en_GB.utf8"); setlocale(LC_ALL, 'en_GB.utf8'); @@ -182,7 +183,6 @@ public function testQualifiedNotationAlphabeticalList() { /** * @covers JenaTextSparql::queryConceptsAlphabetical * @covers JenaTextSparql::generateAlphabeticalListQuery - * @covers JenaTextSparql::transformAlphabeticalListResults */ public function testQualifiedBroaderAlphabeticalList() { $voc = $this->model->getVocabulary('test-qualified-broader'); @@ -270,7 +270,7 @@ public function testQueryConceptsAlphabeticalSpecialChars() { public function testQueryConceptsAlphabeticalNumbers() { $actual = $this->sparql->queryConceptsAlphabetical('0-9', 'en'); $this->assertEquals(1, sizeof($actual)); - $this->assertContains("3D", $actual[0]['prefLabel']); + $this->assertStringContainsString("3D", $actual[0]['prefLabel']); } /** @@ -336,7 +336,7 @@ public function testQueryConceptsAsteriskBeforeTerm() $actual = $this->sparql->queryConcepts(array($voc), null, null, $this->params); $this->assertEquals(3, sizeof($actual)); foreach($actual as $match) - $this->assertContains('bass', $match['prefLabel'], '',true); + $this->assertStringContainsStringIgnoringCase('bass', $match['prefLabel']); } /** diff --git a/tests/ModelTest.php b/tests/ModelTest.php index 1b91bebec..ff4a00d09 100644 --- a/tests/ModelTest.php +++ b/tests/ModelTest.php @@ -5,7 +5,8 @@ class ModelTest extends PHPUnit\Framework\TestCase private $params; private $model; - protected function setUp() { + protected function setUp() : void + { putenv("LANGUAGE=en_GB.utf8"); putenv("LC_ALL=en_GB.utf8"); setlocale(LC_ALL, 'en_GB.utf8'); @@ -15,7 +16,8 @@ protected function setUp() { $this->params->method('getVocabs')->will($this->returnValue(array($this->model->getVocabulary('test')))); } - protected function tearDown() { + protected function tearDown() : void + { $this->params = null; } @@ -74,10 +76,10 @@ public function testGetVocabularyById() { /** * @covers Model::getVocabulary - * @expectedException \Exception - * @expectedExceptionMessage Vocabulary id 'thisshouldnotbefound' not found in configuration */ public function testGetVocabularyByFalseId() { + $this->expectException(ValueError::class); + $this->expectExceptionMessage("Vocabulary id 'thisshouldnotbefound' not found in configuration"); $vocab = $this->model->getVocabulary('thisshouldnotbefound'); $this->assertInstanceOf('Vocabulary', $vocab); } @@ -92,10 +94,10 @@ public function testGetVocabularyByGraphUri() { /** * @covers Model::getVocabularyByGraph - * @expectedException \Exception - * @expectedExceptionMessage no vocabulary found for graph http://no/address and endpoint http://localhost:13030/skosmos-test/sparql */ public function testGetVocabularyByInvalidGraphUri() { + $this->expectException(ValueError::class); + $this->expectExceptionMessage("no vocabulary found for graph http://no/address and endpoint http://localhost:13030/skosmos-test/sparql"); $vocab = $this->model->getVocabularyByGraph('http://no/address'); $this->assertInstanceOf('Vocabulary', $vocab); } @@ -310,7 +312,7 @@ public function testSearchConceptsAndInfoWithOneVocabCaseInsensitivity() { public function testGetRdfCustomPrefix() { $result = $this->model->getRDF('prefix', 'http://www.skosmos.skos/prefix/p1', 'text/turtle'); - $this->assertContains("@prefix my: .", $result); + $this->assertStringContainsString("@prefix my: .", $result); } /** diff --git a/tests/PluginRegisterTest.php b/tests/PluginRegisterTest.php index f5ebd030b..a60c86f70 100644 --- a/tests/PluginRegisterTest.php +++ b/tests/PluginRegisterTest.php @@ -6,7 +6,8 @@ class PluginRegisterTest extends PHPUnit\Framework\TestCase private $concept; private $mockpr; - protected function setUp() { + protected function setUp() : void + { $this->mockpr = $this->getMockBuilder('PluginRegister')->setConstructorArgs(array(array('global-plugin')))->setMethods(array('getPlugins'))->getMock(); $stubplugs = array ('test-plugin' => array ( 'js' => array ( 0 => 'first.js', 1 => 'second.min.js', ), 'css' => array ( 0 => 'stylesheet.css', ), 'templates' => array ( 0 => 'template.html', ), ), 'only-css' => array ( 'css' => array ( 0 => 'super.css')), 'global-plugin' => array('js' => array('everywhere.js'))); $this->mockpr->method('getPlugins')->will($this->returnValue($stubplugs)); diff --git a/tests/RequestTest.php b/tests/RequestTest.php index 9c3df3948..b816bd705 100644 --- a/tests/RequestTest.php +++ b/tests/RequestTest.php @@ -5,7 +5,8 @@ class RequestTest extends PHPUnit\Framework\TestCase private $model; private $request; - protected function setUp() { + protected function setUp() : void + { putenv("LANGUAGE=en_GB.utf8"); putenv("LC_ALL=en_GB.utf8"); setlocale(LC_ALL, 'en_GB.utf8'); diff --git a/tests/ResolverTest.php b/tests/ResolverTest.php index 710d8adc3..397db2b2d 100644 --- a/tests/ResolverTest.php +++ b/tests/ResolverTest.php @@ -4,7 +4,8 @@ class ResolverTest extends PHPUnit\Framework\TestCase { private $resolver; - protected function setUp() { + protected function setUp() : void + { $model = new Model(new GlobalConfig('/../tests/testconfig.ttl')); $this->resolver = new Resolver($model); } diff --git a/tests/RestControllerTest.php b/tests/RestControllerTest.php index fbcb2ae9f..a8b6c698d 100644 --- a/tests/RestControllerTest.php +++ b/tests/RestControllerTest.php @@ -15,7 +15,8 @@ class RestControllerTest extends \PHPUnit\Framework\TestCase * @var RestController */ private $controller; - protected function setUp() { + protected function setUp() : void + { putenv("LANGUAGE=en_GB.utf8"); putenv("LC_ALL=en_GB.utf8"); setlocale(LC_ALL, 'en_GB.utf8'); @@ -28,7 +29,8 @@ protected function setUp() { $this->controller = new RestController($this->model); } - protected function tearDown() { + protected function tearDown() : void + { ob_clean(); } diff --git a/tests/VocabularyCategoryTest.php b/tests/VocabularyCategoryTest.php index 0aaae94fd..3c77a520d 100644 --- a/tests/VocabularyCategoryTest.php +++ b/tests/VocabularyCategoryTest.php @@ -5,7 +5,8 @@ class VocabularyCategoryTest extends PHPUnit\Framework\TestCase private $model; private $mockres; - protected function setUp() { + protected function setUp() : void + { putenv("LANGUAGE=en_GB.utf8"); putenv("LC_ALL=en_GB.utf8"); setlocale(LC_ALL, 'en_GB.utf8'); @@ -16,10 +17,10 @@ protected function setUp() { /** * @covers VocabularyCategory::__construct - * @expectedException Exception - * @expectedExceptionMessage Invalid constructor parameter given to DataObject. */ public function testConstructorWithInvalidParameters() { + $this->expectException(InvalidArgumentException::class); + $this->expectExceptionMessage("Invalid constructor parameter given to DataObject"); $vcat = new VocabularyCategory('invalid', 'invalid'); $this->assertNotNull($vcat); } diff --git a/tests/VocabularyConfigTest.php b/tests/VocabularyConfigTest.php index cc9fd9797..aa0b43c8e 100644 --- a/tests/VocabularyConfigTest.php +++ b/tests/VocabularyConfigTest.php @@ -9,7 +9,8 @@ class VocabularyConfigTest extends PHPUnit\Framework\TestCase * @covers VocabularyConfig::getConfig * @throws Exception */ - protected function setUp() { + protected function setUp() : void + { putenv("LANGUAGE=en_GB.utf8"); putenv("LC_ALL=en_GB.utf8"); setlocale(LC_ALL, 'en_GB.utf8'); @@ -111,10 +112,11 @@ public function testGetDefaultLanguage() { /** * @covers VocabularyConfig::getDefaultLanguage - * @expectedException PHPUnit\Framework\Error\Error */ public function testGetDefaultLanguageWhenNotSet() { $vocab = $this->model->getVocabulary('testdiff'); + $this->expectError(); + $this->expectErrorMessage("Default language for vocabulary 'testdiff' unknown, choosing 'en'."); $lang = $vocab->getConfig()->getDefaultLanguage(); } @@ -170,10 +172,11 @@ public function testGetDataURLs() { /** * @covers VocabularyConfig::getDataURLs - * @expectedException PHPUnit\Framework\Error\Warning */ public function testGetDataURLsNotGuessable() { $vocab = $this->model->getVocabulary('test'); + $this->expectWarning(); + $this->expectWarningMessage("Could not guess format for ."); $url = $vocab->getConfig()->getDataURLs(); } @@ -199,10 +202,11 @@ public function testGetDataURLsMarc() { /** * @covers VocabularyConfig::getDataURLs - * @expectedException PHPUnit\Framework\Error\Warning */ public function testGetDataURLsMarcNotDefined() { $vocab = $this->model->getVocabulary('marc-undefined'); + $this->expectWarning(); + $this->expectWarningMessage("Could not guess format for ."); $url = $vocab->getConfig()->getDataURLs(); $this->assertEquals(array(), $url); } @@ -522,10 +526,11 @@ public function testGetPropertyOrderDefault() { /** * @covers VocabularyConfig::getPropertyOrder - * @expectedException PHPUnit\Framework\Error\Error */ public function testGetPropertyOrderUnknown() { $vocab = $this->model->getVocabulary('testUnknownPropertyOrder'); + $this->expectWarning(); + $this->expectWarningMessage("Property order for vocabulary 'testUnknownPropertyOrder' unknown, using default order"); $params = $vocab->getConfig()->getPropertyOrder(); $this->assertEquals(VocabularyConfig::DEFAULT_PROPERTY_ORDER, $params); } diff --git a/tests/VocabularyTest.php b/tests/VocabularyTest.php index 8cfe693c1..3e333fc1a 100644 --- a/tests/VocabularyTest.php +++ b/tests/VocabularyTest.php @@ -7,7 +7,8 @@ class VocabularyTest extends \PHPUnit\Framework\TestCase */ private $model; - protected function setUp() { + protected function setUp() : void + { putenv("LANGUAGE=en_GB.utf8"); putenv("LC_ALL=en_GB.utf8"); setlocale(LC_ALL, 'en_GB.utf8'); @@ -285,7 +286,7 @@ public function testSearchConceptsAlphabeticalQualifiedNotationGeneric() { * @covers Vocabulary::searchConceptsAlphabetical * @covers JenaTextSparql::queryConceptsAlphabetical * @covers JenaTextSparql::generateAlphabeticalListQuery - * @covers JenaTextSparql::transformAlphabeticalListResults + * @covers GenericSparql::transformAlphabeticalListResults */ public function testSearchConceptsAlphabeticalQualifiedNotation() { $vocab = $this->jenamodel->getVocabulary('test-qualified-notation'); @@ -328,7 +329,7 @@ public function testSearchConceptsAlphabeticalQualifiedBroaderGeneric() { * @covers Vocabulary::searchConceptsAlphabetical * @covers JenaTextSparql::queryConceptsAlphabetical * @covers JenaTextSparql::generateAlphabeticalListQuery - * @covers JenaTextSparql::transformAlphabeticalListResults + * @covers GenericSparql::transformAlphabeticalListResults */ public function testSearchConceptsAlphabeticalQualifiedBroader() { $vocab = $this->jenamodel->getVocabulary('test-qualified-broader'); diff --git a/tests/WebControllerTest.php b/tests/WebControllerTest.php index 1a9bfcbaf..3acb41b5e 100644 --- a/tests/WebControllerTest.php +++ b/tests/WebControllerTest.php @@ -7,7 +7,8 @@ class WebControllerTest extends TestCase private $webController; private $model; - protected function setUp() { + protected function setUp() : void + { $globalConfig = new GlobalConfig('/../tests/testconfig.ttl'); $this->model = Mockery::mock(new Model($globalConfig)); $this->webController = new WebController($this->model);