Skip to content

Commit 91ac9c7

Browse files
committed
fix(test): make tests compatible with phpunit 9 and 10.
1 parent c7808e9 commit 91ac9c7

File tree

93 files changed

+140
-100
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

93 files changed

+140
-100
lines changed

test/Field/Auth/LoginFieldTest.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,7 @@ public function testLoginSuccess()
4040
$res->data->login->statusCode,
4141
"Unable to login via GraphQL"
4242
);
43-
self::assertObjectNotHasProperty("errors", $res, "There are errors.");
43+
self::assertObjectNotHasPropertyOrAttribute("errors", $res, "There are errors.");
4444
}
4545

4646
public function testLoginFailure()
@@ -59,6 +59,6 @@ public function testLoginFailure()
5959
$res->data->login->statusCode,
6060
"Unable to login via GraphQL"
6161
);
62-
self::assertObjectNotHasProperty("errors", $res, "There are errors.");
62+
self::assertObjectNotHasPropertyOrAttribute("errors", $res, "There are errors.");
6363
}
6464
}

test/Field/Auth/LogoutFieldTest.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,7 @@ public function testLogout()
3030
$res->data->logout->statusCode,
3131
"Unable to logout via GraphQL"
3232
);
33-
self::assertObjectNotHasProperty("errors", $res, "There are errors.");
33+
self::assertObjectNotHasPropertyOrAttribute("errors", $res, "There are errors.");
3434
}
3535

3636
public function testLogoutFailure()
@@ -41,7 +41,7 @@ public function testLogoutFailure()
4141
}
4242
}';
4343
$res = self::execute($query);
44-
self::assertObjectHasProperty(
44+
self::assertObjectHasPropertyOrAttribute(
4545
"errors",
4646
$res,
4747
"Unable to logout via GraphQL"

test/Field/Debug/DbQueryCountFieldTest.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@ public function testUnavailable()
2828
dbQuery
2929
}';
3030
$res = self::execute($query);
31-
self::assertObjectHasProperty(
31+
self::assertObjectHasPropertyOrAttribute(
3232
"errors",
3333
$res,
3434
"When debug turned off, `dbQueryCount` field must be unavailable."
@@ -52,6 +52,6 @@ public function testValue()
5252
count($res->data->dbQuery),
5353
"`dbQueryCount` must return the number of db query logs"
5454
);
55-
self::assertObjectNotHasProperty("errors", $res, "There are errors.");
55+
self::assertObjectNotHasPropertyOrAttribute("errors", $res, "There are errors.");
5656
}
5757
}

test/Field/Mutation/CreatePage/CaseThreeTest.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -45,6 +45,6 @@ public function testValue()
4545
$res->data->skyscraper->id,
4646
"createSkyscraper creates skyscraper page if everything is ok."
4747
);
48-
self::assertObjectNotHasProperty("errors", $res, "There are errors.");
48+
self::assertObjectNotHasPropertyOrAttribute("errors", $res, "There are errors.");
4949
}
5050
}

test/Field/Mutation/UpdatePage/CaseThreeTest.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -51,6 +51,6 @@ public function testValue()
5151
$skyscraper->title,
5252
"updateSkyscraper updates value of the `title`."
5353
);
54-
self::assertObjectNotHasProperty("errors", $res, "There are errors.");
54+
self::assertObjectNotHasPropertyOrAttribute("errors", $res, "There are errors.");
5555
}
5656
}

test/Field/Page/Fieldtype/FieldtypeCheckbox/FieldtypeCheckboxTest.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -44,6 +44,6 @@ public function testFalsyValue()
4444
}";
4545
$res = $this->execute($query);
4646
self::assertTrue($res->data->skyscraper->list[0]->featured);
47-
self::assertObjectNotHasProperty("errors", $res, "There are errors.");
47+
self::assertObjectNotHasPropertyOrAttribute("errors", $res, "There are errors.");
4848
}
4949
}

test/Field/Page/Fieldtype/FieldtypeDatetime/CaseFourTest.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -38,6 +38,6 @@ public function testValue()
3838
$res->data->architect->born,
3939
"Accepts string as an input value."
4040
);
41-
self::assertObjectNotHasProperty("errors", $res, "There are errors.");
41+
self::assertObjectNotHasPropertyOrAttribute("errors", $res, "There are errors.");
4242
}
4343
}

test/Field/Page/Fieldtype/FieldtypeDatetime/CaseOneTest.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -38,6 +38,6 @@ public function testValue()
3838
$res->data->architect->list[0]->born,
3939
"Retrieves datetime value."
4040
);
41-
self::assertObjectNotHasProperty("errors", $res, "There are errors.");
41+
self::assertObjectNotHasPropertyOrAttribute("errors", $res, "There are errors.");
4242
}
4343
}

test/Field/Page/Fieldtype/FieldtypeDatetime/CaseThreeTest.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -34,6 +34,6 @@ public function testValue()
3434
$res->data->architect->list[0]->born,
3535
"Formats datetime value correctly via format argument."
3636
);
37-
self::assertObjectNotHasProperty("errors", $res, "There are errors.");
37+
self::assertObjectNotHasPropertyOrAttribute("errors", $res, "There are errors.");
3838
}
3939
}

test/Field/Page/Fieldtype/FieldtypeDatetime/CaseTwoTest.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -42,6 +42,6 @@ public function testValue()
4242
$res->data->architect->list[0]->born,
4343
"Retrieves correctly formatted datetime value."
4444
);
45-
self::assertObjectNotHasProperty("errors", $res, "There are errors.");
45+
self::assertObjectNotHasPropertyOrAttribute("errors", $res, "There are errors.");
4646
}
4747
}

0 commit comments

Comments
 (0)