Skip to content

Commit a16a0c3

Browse files
committed
Adjust expected errors for PHP 8
1 parent 17bb6b1 commit a16a0c3

1 file changed

Lines changed: 4 additions & 4 deletions

File tree

test/unit/ExtendedGraphTest.php

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -68,7 +68,7 @@ public function addInvalidValueToLiteralResultsInNoTriple_Provider(): iterable
6868
*/
6969
public function testAddInvalidSubjectToLiteralThrowsException($value): void
7070
{
71-
$this->expectExceptionMessageMatches('/^(The subject is invalid|Argument 1.+must be of the type string.+)$/');
71+
$this->expectExceptionMessageMatches('/^The subject is invalid$|Argument #?1.+must be of (the )?type string.+/');
7272

7373
$graph = new ExtendedGraph();
7474
$graph->add_resource_triple($value, 'http://some/predicate', 'http://someplace.com');
@@ -93,7 +93,7 @@ public function addInvalidSubjectToLiteralResultsInNoTriple_Provider(): iterable
9393
*/
9494
public function testAddInvalidPredicateToLiteralThrowsException($value): void
9595
{
96-
$this->expectExceptionMessageMatches('/^(The predicate is invalid|Argument 2.+must be of the type string.+)$/');
96+
$this->expectExceptionMessageMatches('/^The predicate is invalid$|Argument #?2.+must be of (the )?type string.+/');
9797

9898
$graph = new ExtendedGraph();
9999
$graph->add_resource_triple('http://some/subject/1', $value, 'http://someplace.com');
@@ -163,7 +163,7 @@ public function addInvalidValueToResourceResultsInNoTriple_Provider(): iterable
163163
*/
164164
public function testAddInvalidSubjectToResourceThrowsException($value): void
165165
{
166-
$this->expectExceptionMessageMatches('/^(The subject is invalid|Argument 1.+must be of the type string.+)$/');
166+
$this->expectExceptionMessageMatches('/^The subject is invalid$|Argument #?1.+must be of (the )?type string.+/');
167167

168168
$graph = new ExtendedGraph();
169169
$graph->add_resource_triple($value, 'http://some/predicate', 'http://someplace.com');
@@ -188,7 +188,7 @@ public function addInvalidSubjectToResourceResultsInNoTriple_Provider(): iterabl
188188
*/
189189
public function testAddInvalidPredicateToResourceThrowsException($value): void
190190
{
191-
$this->expectExceptionMessageMatches('/^(The predicate is invalid|Argument 2.+must be of the type string.+)$/');
191+
$this->expectExceptionMessageMatches('/^The predicate is invalid$|Argument #?2.+must be of (the )?type string.+/');
192192

193193
$graph = new ExtendedGraph();
194194
$graph->add_resource_triple('http://some/subject/1', $value, 'http://someplace.com');

0 commit comments

Comments
 (0)