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

+2-2
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

+2-2
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

+2-2
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

+1-1
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

+1-1
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

+1-1
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

+1-1
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

+1-1
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

+1-1
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

+1-1
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
}

test/Field/Page/Fieldtype/FieldtypeEmail/FieldtypeEmailTest.php

+1-1
Original file line numberDiff line numberDiff line change
@@ -34,6 +34,6 @@ public function testValue()
3434
$res->data->architect->list[0]->email,
3535
"Retrieves email value."
3636
);
37-
self::assertObjectNotHasProperty("errors", $res, "There are errors.");
37+
self::assertObjectNotHasPropertyOrAttribute("errors", $res, "There are errors.");
3838
}
3939
}

test/Field/Page/Fieldtype/FieldtypeFile/FieldtypeFileTest.php

+1-1
Original file line numberDiff line numberDiff line change
@@ -36,6 +36,6 @@ public function testValue()
3636
$res->data->architect->list[0]->resume[0]->url,
3737
"Retrieves files value."
3838
);
39-
self::assertObjectNotHasProperty("errors", $res, "There are errors.");
39+
self::assertObjectNotHasPropertyOrAttribute("errors", $res, "There are errors.");
4040
}
4141
}

test/Field/Page/Fieldtype/FieldtypeFloat/FieldtypeFloatTest.php

+1-1
Original file line numberDiff line numberDiff line change
@@ -36,6 +36,6 @@ public function testValue()
3636
$res->data->skyscraper->list[0]->height,
3737
"Retrieves field value."
3838
);
39-
self::assertObjectNotHasProperty("errors", $res, "There are errors.");
39+
self::assertObjectNotHasPropertyOrAttribute("errors", $res, "There are errors.");
4040
}
4141
}

test/Field/Page/Fieldtype/FieldtypeImage/DimensionsTest.php

+1-1
Original file line numberDiff line numberDiff line change
@@ -44,6 +44,6 @@ public function testDimensions()
4444
$res->data->skyscraper->list[0]->images[0]->width,
4545
"Retrieves image width."
4646
);
47-
self::assertObjectNotHasProperty("errors", $res, "There are errors.");
47+
self::assertObjectNotHasPropertyOrAttribute("errors", $res, "There are errors.");
4848
}
4949
}

test/Field/Page/Fieldtype/FieldtypeImage/ThumbCaseFourTest.php

+1-1
Original file line numberDiff line numberDiff line change
@@ -109,7 +109,7 @@ public function testThumbCreate()
109109

110110
// execute graphql
111111
$res = self::execute($query);
112-
self::assertObjectNotHasProperty("errors", $res, "There are errors.");
112+
self::assertObjectNotHasPropertyOrAttribute("errors", $res, "There are errors.");
113113

114114
// the thumb created by graphql
115115
$actualThumb = $res->data->skyscraper->list[0]->images[0]->size;

test/Field/Page/Fieldtype/FieldtypeImage/ThumbCaseOneTest.php

+1-1
Original file line numberDiff line numberDiff line change
@@ -59,7 +59,7 @@ public function testThumbCreate()
5959

6060
// execute graphql
6161
$res = self::execute($query);
62-
self::assertObjectNotHasProperty("errors", $res, "There are errors.");
62+
self::assertObjectNotHasPropertyOrAttribute("errors", $res, "There are errors.");
6363

6464
// the thumb created by graphql
6565
$actualThumb = $res->data->skyscraper->list[0]->images[0]->size;

test/Field/Page/Fieldtype/FieldtypeImage/ThumbCaseThreeTest.php

+1-1
Original file line numberDiff line numberDiff line change
@@ -95,7 +95,7 @@ public function testThumbCreate()
9595
}";
9696

9797
$res = self::execute($query);
98-
self::assertObjectNotHasProperty("errors", $res, "There are errors.");
98+
self::assertObjectNotHasPropertyOrAttribute("errors", $res, "There are errors.");
9999

100100
$expectedThumb = $res->data->skyscraper->list[0]->images[0]->size;
101101

test/Field/Page/Fieldtype/FieldtypeImage/ThumbCaseTwoTest.php

+1-1
Original file line numberDiff line numberDiff line change
@@ -99,7 +99,7 @@ public function testThumbCreate()
9999
}";
100100

101101
$res = self::execute($query);
102-
self::assertObjectNotHasProperty("errors", $res, "There are errors.");
102+
self::assertObjectNotHasPropertyOrAttribute("errors", $res, "There are errors.");
103103

104104
$expectedThumb = $res->data->skyscraper->list[0]->images[0]->size;
105105

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

+1-1
Original file line numberDiff line numberDiff line change
@@ -34,6 +34,6 @@ public function testValue()
3434
$res->data->skyscraper->list[0]->floors,
3535
"Retrieves field value."
3636
);
37-
self::assertObjectNotHasProperty("errors", $res, "There are errors.");
37+
self::assertObjectNotHasPropertyOrAttribute("errors", $res, "There are errors.");
3838
}
3939
}

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

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

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

+1-1
Original file line numberDiff line numberDiff line change
@@ -31,6 +31,6 @@ public function testValue()
3131
$res->data->skyscraper->list[0]->floors,
3232
"Retrieves incorrect value."
3333
);
34-
self::assertObjectNotHasProperty("errors", $res, "There are errors.");
34+
self::assertObjectNotHasPropertyOrAttribute("errors", $res, "There are errors.");
3535
}
3636
}

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

+1-1
Original file line numberDiff line numberDiff line change
@@ -56,6 +56,6 @@ public function testValue()
5656
$actualMap->zoom,
5757
"Retreives correct zoom."
5858
);
59-
self::assertObjectNotHasProperty("errors", $res, "There are errors.");
59+
self::assertObjectNotHasPropertyOrAttribute("errors", $res, "There are errors.");
6060
}
6161
}

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

+1-1
Original file line numberDiff line numberDiff line change
@@ -74,6 +74,6 @@ public function testValue()
7474
$actualMap->zoom,
7575
"Updates zoom correctly."
7676
);
77-
self::assertObjectNotHasProperty("errors", $res, "There are errors.");
77+
self::assertObjectNotHasPropertyOrAttribute("errors", $res, "There are errors.");
7878
}
7979
}

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

+1-1
Original file line numberDiff line numberDiff line change
@@ -88,6 +88,6 @@ public function testValue()
8888
$actualMap->zoom,
8989
"Retreives correct zoom."
9090
);
91-
self::assertObjectNotHasProperty("errors", $res, "There are errors.");
91+
self::assertObjectNotHasPropertyOrAttribute("errors", $res, "There are errors.");
9292
}
9393
}

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

+1-1
Original file line numberDiff line numberDiff line change
@@ -46,7 +46,7 @@ public function testValue()
4646
],
4747
];
4848
$res = self::execute($query, $variables);
49-
self::assertObjectNotHasProperty("errors", $res, "There are errors.");
49+
self::assertObjectNotHasPropertyOrAttribute("errors", $res, "There are errors.");
5050

5151
$newArchitect = Utils::pages()->get("template=architect, name=$name");
5252
self::assertTrue(

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

+1-1
Original file line numberDiff line numberDiff line change
@@ -43,6 +43,6 @@ public function testValue()
4343
$res->data->architect->list[0]->options[2]->id,
4444
"Retrieves correct option id at 2."
4545
);
46-
self::assertObjectNotHasProperty("errors", $res, "There are errors.");
46+
self::assertObjectNotHasPropertyOrAttribute("errors", $res, "There are errors.");
4747
}
4848
}

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

+1-1
Original file line numberDiff line numberDiff line change
@@ -45,7 +45,7 @@ public function testValue()
4545
],
4646
];
4747
$res = self::execute($query, $variables);
48-
self::assertObjectNotHasProperty("errors", $res, "There are errors.");
48+
self::assertObjectNotHasPropertyOrAttribute("errors", $res, "There are errors.");
4949

5050
$newCity = Utils::pages()->get("template=city, name=$name");
5151
self::assertTrue(!$newCity instanceof NullPage, "New Page is created.");

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

+1-1
Original file line numberDiff line numberDiff line change
@@ -43,6 +43,6 @@ public function testValue()
4343
$res->data->city->list[0]->options_single->id,
4444
"Retrieves correct option id."
4545
);
46-
self::assertObjectNotHasProperty("errors", $res, "There are errors.");
46+
self::assertObjectNotHasPropertyOrAttribute("errors", $res, "There are errors.");
4747
}
4848
}

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

+1-1
Original file line numberDiff line numberDiff line change
@@ -85,6 +85,6 @@ public function testAnotherValue()
8585
$res->data->skyscraper->list[0]->architects->last,
8686
"Returns empty last item."
8787
);
88-
self::assertObjectNotHasProperty("errors", $res, "There are errors.");
88+
self::assertObjectNotHasPropertyOrAttribute("errors", $res, "There are errors.");
8989
}
9090
}

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

+1-1
Original file line numberDiff line numberDiff line change
@@ -56,6 +56,6 @@ public function testValue()
5656
"Returns empty architect page array."
5757
);
5858

59-
self::assertObjectNotHasProperty("errors", $res, "There are errors.");
59+
self::assertObjectNotHasPropertyOrAttribute("errors", $res, "There are errors.");
6060
}
6161
}

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

+1-1
Original file line numberDiff line numberDiff line change
@@ -53,6 +53,6 @@ public function testValue()
5353
$res->data->skyscraper->list[0]->architects->list[1]->id,
5454
"Returns correct second architect page."
5555
);
56-
self::assertObjectNotHasProperty("errors", $res, "There are errors.");
56+
self::assertObjectNotHasPropertyOrAttribute("errors", $res, "There are errors.");
5757
}
5858
}

test/Field/Page/Fieldtype/FieldtypePageTitle/FieldtypePageTitleTest.php

+1-1
Original file line numberDiff line numberDiff line change
@@ -34,6 +34,6 @@ public function testValue()
3434
$res->data->skyscraper->list[0]->title,
3535
"Retrieves title value."
3636
);
37-
self::assertObjectNotHasProperty("errors", $res, "There are errors.");
37+
self::assertObjectNotHasPropertyOrAttribute("errors", $res, "There are errors.");
3838
}
3939
}

test/Field/Page/Fieldtype/FieldtypeRepeater/CaseFiveTest.php

+1-1
Original file line numberDiff line numberDiff line change
@@ -84,6 +84,6 @@ public function testValue()
8484
$res->data->listAll->list[0]->slides->list[0]->body,
8585
"Returns correct body for the first repeater item"
8686
);
87-
self::assertObjectNotHasProperty("errors", $res, "There are errors.");
87+
self::assertObjectNotHasPropertyOrAttribute("errors", $res, "There are errors.");
8888
}
8989
}

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

+1-1
Original file line numberDiff line numberDiff line change
@@ -76,6 +76,6 @@ public function testValue()
7676
$res->data->updateListAll->slides->list[0]->selected,
7777
"Updates the selected correctly."
7878
);
79-
self::assertObjectNotHasProperty("errors", $res, "There are errors.");
79+
self::assertObjectNotHasPropertyOrAttribute("errors", $res, "There are errors.");
8080
}
8181
}

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

+1-1
Original file line numberDiff line numberDiff line change
@@ -50,6 +50,6 @@ public function testValue()
5050
$res->data->listAll->list[0]->slides->list[0]->title,
5151
"Returns correct title for the first repeater item"
5252
);
53-
self::assertObjectNotHasProperty("errors", $res, "There are errors.");
53+
self::assertObjectNotHasPropertyOrAttribute("errors", $res, "There are errors.");
5454
}
5555
}

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

+1-1
Original file line numberDiff line numberDiff line change
@@ -60,6 +60,6 @@ public function testValue()
6060
$res->data->updateListAll->slides->list[0]->id,
6161
"Removes the correct repeater items."
6262
);
63-
self::assertObjectNotHasProperty("errors", $res, "There are errors.");
63+
self::assertObjectNotHasPropertyOrAttribute("errors", $res, "There are errors.");
6464
}
6565
}

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

+1-1
Original file line numberDiff line numberDiff line change
@@ -69,6 +69,6 @@ public function testValue()
6969
count($res->data->createListAll->slides->list),
7070
"Creates wrong amount of repeater items."
7171
);
72-
self::assertObjectNotHasProperty("errors", $res, "There are errors.");
72+
self::assertObjectNotHasPropertyOrAttribute("errors", $res, "There are errors.");
7373
}
7474
}

test/Field/Page/Fieldtype/FieldtypeSelector/FieldtypeSelectorTest.php

+1-1
Original file line numberDiff line numberDiff line change
@@ -34,6 +34,6 @@ public function testValue()
3434
$res->data->home->list[0]->selected,
3535
"Retrieves selector value."
3636
);
37-
self::assertObjectNotHasProperty("errors", $res, "There are errors.");
37+
self::assertObjectNotHasPropertyOrAttribute("errors", $res, "There are errors.");
3838
}
3939
}

test/Field/Page/Fieldtype/FieldtypeText/FieldtypeTextTest.php

+1-1
Original file line numberDiff line numberDiff line change
@@ -34,6 +34,6 @@ public function testValue()
3434
$res->data->skyscraper->list[0]->freebase_guid,
3535
"Retrieves freebase_guid value."
3636
);
37-
self::assertObjectNotHasProperty("errors", $res, "There are errors.");
37+
self::assertObjectNotHasPropertyOrAttribute("errors", $res, "There are errors.");
3838
}
3939
}

test/Field/Page/Fieldtype/FieldtypeTextLanguage/FieldtypeTextLanguageTest.php

+2-2
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,7 @@ public function testValue()
3434
$res->data->basicPage->list[0]->creator,
3535
"Retrieves creator value."
3636
);
37-
self::assertObjectNotHasProperty("errors", $res, "There are errors.");
37+
self::assertObjectNotHasPropertyOrAttribute("errors", $res, "There are errors.");
3838
}
3939

4040
public function testLanguageValue()
@@ -57,6 +57,6 @@ public function testLanguageValue()
5757
$res->data->basicPage->list[0]->creator,
5858
"Retrieves creator language value."
5959
);
60-
self::assertObjectNotHasProperty("errors", $res, "There are errors.");
60+
self::assertObjectNotHasPropertyOrAttribute("errors", $res, "There are errors.");
6161
}
6262
}

test/Field/Page/Fieldtype/FieldtypeTextarea/FieldtypeTextareaTest.php

+1-1
Original file line numberDiff line numberDiff line change
@@ -34,6 +34,6 @@ public function testValue()
3434
$res->data->skyscraper->list[0]->body,
3535
"Retrieves body value."
3636
);
37-
self::assertObjectNotHasProperty("errors", $res, "There are errors.");
37+
self::assertObjectNotHasPropertyOrAttribute("errors", $res, "There are errors.");
3838
}
3939
}

test/Field/Page/Fieldtype/FieldtypeTextareaLanguage/FieldtypeTextareaLanguageTest.php

+2-2
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,7 @@ public function testValue()
3434
$res->data->basicPage->list[0]->address,
3535
"Retrieves address value."
3636
);
37-
self::assertObjectNotHasProperty("errors", $res, "There are errors.");
37+
self::assertObjectNotHasPropertyOrAttribute("errors", $res, "There are errors.");
3838
}
3939

4040
public function testLanguageValue()
@@ -57,6 +57,6 @@ public function testLanguageValue()
5757
$res->data->basicPage->list[0]->address,
5858
"Retrieves address language value."
5959
);
60-
self::assertObjectNotHasProperty("errors", $res, "There are errors.");
60+
self::assertObjectNotHasPropertyOrAttribute("errors", $res, "There are errors.");
6161
}
6262
}

test/Field/Page/Fieldtype/FieldtypeURL/FieldtypeURLTest.php

+1-1
Original file line numberDiff line numberDiff line change
@@ -34,6 +34,6 @@ public function testValue()
3434
$res->data->home->list[0]->sponsor,
3535
"Retrieves sponsor value."
3636
);
37-
self::assertObjectNotHasProperty("errors", $res, "There are errors.");
37+
self::assertObjectNotHasPropertyOrAttribute("errors", $res, "There are errors.");
3838
}
3939
}

0 commit comments

Comments
 (0)