@@ -227,7 +227,8 @@ public function testGetMappingPropertiesWithIdenticalLabels()
227227 {
228228 $ vocab = $ this ->model ->getVocabulary ('duplicates ' );
229229 $ concept = $ vocab ->getConceptInfo ("http://www.skosmos.skos/dup/d3 " , "en " );
230- $ props = $ concept ->getMappingProperties ();
230+ // suppress fsockopen PHP warnings caused by trying to resolve www.skosmos.skos
231+ @$ props = $ concept ->getMappingProperties ();
231232 $ values = $ props ['skos:closeMatch ' ]->getValues ();
232233 $ this ->assertCount (2 , $ values );
233234 }
@@ -312,22 +313,21 @@ public function testGetDateWithCreatedAndModified()
312313 */
313314 public function testGetTimestampInvalidWarning ()
314315 {
315- set_error_handler (function ($ code , $ message ) {
316- throw new \PHPUnit \Framework \Error ($ message , $ code );
317- });
316+ set_error_handler (
317+ static function ( $ errno , $ errstr ) {
318+ restore_error_handler ();
319+ throw new UserWarning ( $ errstr , $ errno );
320+ },
321+ E_ALL
322+ );
318323
319- try {
320- $ vocab = $ this ->model ->getVocabulary ('test ' );
321-
322- $ this ->expectException (\PHPUnit \Framework \Error::class);
323- $ this ->expectExceptionMessage ("Failed to parse time string (1986-21-00) at position 6 (1): Unexpected character " );
324+ $ vocab = $ this ->model ->getVocabulary ('test ' );
324325
325- $ concept = $ vocab -> getConceptInfo ( " http://www.skosmos.skos/test/ta114 " , " en " );
326- $ concept -> getDate (); # this should throw an ErrorException
326+ $ this -> expectException (UserWarning::class );
327+ $ this -> expectExceptionMessage ( " Failed to parse time string (1986-21-00) at position 6 (1): Unexpected character " );
327328
328- } finally {
329- restore_error_handler ();
330- }
329+ $ concept = $ vocab ->getConceptInfo ("http://www.skosmos.skos/test/ta114 " , "en " );
330+ $ concept ->getDate (); # this should throw an ErrorException
331331 }
332332
333333 /**
@@ -612,7 +612,7 @@ public function testProcessExternalResource()
612612 * Data provider for testGetModifiedDate test method.
613613 * @return array
614614 */
615- public function modifiedDateDataProvider ()
615+ public static function modifiedDateDataProvider ()
616616 {
617617 return [
618618 ["cat " , "2018-12-13T06:28:14 " , "+00:00 " ], # set #0
0 commit comments