diff --git a/tests/ConceptPropertyValueLiteralTest.php b/tests/ConceptPropertyValueLiteralTest.php
index 4b7bee32..c1987eb0 100644
--- a/tests/ConceptPropertyValueLiteralTest.php
+++ b/tests/ConceptPropertyValueLiteralTest.php
@@ -61,14 +61,14 @@ public function testGetLabelThatIsADate()
*/
public function testGetLabelThatIsABrokenDate()
{
- set_error_handler(function ($errno, $errstr, $errfile, $errline) {
- throw new \ErrorException($errstr, $errno, 0, $errfile, $errline);
+ set_error_handler(function ($code, $message, $file, $line) {
+ throw new \PHPUnit\Framework\Error($message);
});
try {
$vocab = $this->model->getVocabulary('dates');
- $this->expectException(\ErrorException::class);
+ $this->expectException(\PHPUnit\Framework\Error::class);
$this->expectExceptionMessage("Failed to parse time string (1986-21-00) at position 6 (1): Unexpected character");
$concept = $vocab->getConceptInfo("http://www.skosmos.skos/date/d2", "en");
diff --git a/tests/ConceptTest.php b/tests/ConceptTest.php
index bd283cf1..1dc91843 100644
--- a/tests/ConceptTest.php
+++ b/tests/ConceptTest.php
@@ -312,18 +312,18 @@ public function testGetDateWithCreatedAndModified()
*/
public function testGetTimestampInvalidWarning()
{
- set_error_handler(function ($errno, $errstr, $errfile, $errline) {
- throw new \ErrorException($errstr, $errno, 0, $errfile, $errline);
+ set_error_handler(function ($code, $message, $file, $line) {
+ throw new \PHPUnit\Framework\Error($message);
});
try {
$vocab = $this->model->getVocabulary('test');
- $this->expectException(\ErrorException::class);
+ $this->expectException(\PHPUnit\Framework\Error::class);
$this->expectExceptionMessage("Failed to parse time string (1986-21-00) at position 6 (1): Unexpected character");
$concept = $vocab->getConceptInfo("http://www.skosmos.skos/test/ta114", "en");
- $props = $concept->getDate(); # this should throw an ErrorException
+ $concept->getDate(); # this should throw an ErrorException
} finally {
restore_error_handler();
diff --git a/tests/VocabularyConfigTest.php b/tests/VocabularyConfigTest.php
index 907a7bf2..be0bc46a 100644
--- a/tests/VocabularyConfigTest.php
+++ b/tests/VocabularyConfigTest.php
@@ -166,12 +166,12 @@ public function testGetDefaultLanguage()
*/
public function testGetDefaultLanguageWhenNotSet()
{
- set_error_handler(function ($errno, $errstr, $errfile, $errline) {
- throw new \ErrorException($errstr, $errno, 0, $errfile, $errline);
+ set_error_handler(function ($code, $message, $file, $line) {
+ throw new \PHPUnit\Framework\Error($message);
});
try {
$vocab = $this->model->getVocabulary('testdiff');
- $this->expectException(\ErrorException::class);
+ $this->expectException(\PHPUnit\Framework\Error::class);
$this->expectExceptionMessage("Default language for vocabulary 'testdiff' unknown, choosing 'en'.");
$lang = $vocab->getConfig()->getDefaultLanguage();
} finally {
@@ -219,13 +219,13 @@ public function testGetDataURLs()
*/
public function testGetDataURLsNotGuessable()
{
- set_error_handler(function ($errno, $errstr, $errfile, $errline) {
- throw new \ErrorException($errstr, $errno, 0, $errfile, $errline);
+ set_error_handler(function ($code, $message, $file, $line) {
+ throw new \PHPUnit\Framework\Error($message);
});
try {
$vocab = $this->model->getVocabulary('test');
- $this->expectException(\ErrorException::class);
+ $this->expectException(\PHPUnit\Framework\Error::class);
$this->expectExceptionMessage("Could not guess format for .");
$url = $vocab->getConfig()->getDataURLs();
@@ -261,14 +261,14 @@ public function testGetDataURLsMarc()
*/
public function testGetDataURLsMarcNotDefined()
{
- set_error_handler(function ($errno, $errstr, $errfile, $errline) {
- throw new \ErrorException($errstr, $errno, 0, $errfile, $errline);
+ set_error_handler(function ($code, $message, $file, $line) {
+ throw new \PHPUnit\Framework\Error($message);
});
try {
$vocab = $this->model->getVocabulary('marc-undefined');
- $this->expectException(\ErrorException::class);
+ $this->expectException(\PHPUnit\Framework\Error::class);
$this->expectExceptionMessage("Could not guess format for .");
$url = $vocab->getConfig()->getDataURLs();
@@ -688,13 +688,13 @@ public function testGetPropertyOrderDefault()
*/
public function testGetPropertyOrderUnknown()
{
- set_error_handler(function ($errno, $errstr, $errfile, $errline) {
- throw new \ErrorException($errstr, $errno, 0, $errfile, $errline);
+ set_error_handler(function ($code, $message, $file, $line) {
+ throw new \PHPUnit\Framework\Error($message);
});
try {
$vocab = $this->model->getVocabulary('testUnknownPropertyOrder');
- $this->expectException(\ErrorException::class);
+ $this->expectException(\PHPUnit\Framework\Error::class);
$this->expectExceptionMessage("Property order for vocabulary 'testUnknownPropertyOrder' unknown, using default order");
$params = $vocab->getConfig()->getPropertyOrder();