Skip to content

Commit 2c3f4ce

Browse files
authored
Merge pull request #978 from arodu/fix-tests
Fix tests
2 parents d6b45a1 + df6dfb4 commit 2c3f4ce

File tree

4 files changed

+11
-11
lines changed

4 files changed

+11
-11
lines changed

.github/workflows/ci.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ jobs:
1313
strategy:
1414
fail-fast: false
1515
matrix:
16-
php-version: ['7.3', '7.4', '8.0']
16+
php-version: ['7.3', '7.4', '8.0', '8.1']
1717
db-type: [sqlite, mysql, pgsql]
1818
prefer-lowest: ['']
1919

tests/TestCase/Controller/Traits/Integration/LoginTraitIntegrationTest.php

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -76,8 +76,8 @@ public function testLoginGetRequestNoSocialLogin()
7676
$this->assertResponseNotContains('Username or password is incorrect');
7777
$this->assertResponseContains('<form method="post" accept-charset="utf-8" action="/login">');
7878
$this->assertResponseContains('<legend>Please enter your username and password</legend>');
79-
$this->assertResponseContains('<input type="text" name="username" required="required" id="username"/>');
80-
$this->assertResponseContains('<input type="password" name="password" required="required" id="password"/>');
79+
$this->assertResponseContains('<input type="text" name="username" required="required" id="username" aria-required="true"/>');
80+
$this->assertResponseContains('<input type="password" name="password" required="required" id="password" aria-required="true"/>');
8181
$this->assertResponseContains('<input type="checkbox" name="remember_me" value="1" checked="checked" id="remember-me">');
8282
$this->assertResponseContains('<button type="submit">Login</button>');
8383
$this->assertResponseContains('<a href="/register">Register</a>');
@@ -102,8 +102,8 @@ public function testLoginGetRequest()
102102
$this->assertResponseNotContains('Username or password is incorrect');
103103
$this->assertResponseContains('<form method="post" accept-charset="utf-8" action="/login">');
104104
$this->assertResponseContains('<legend>Please enter your username and password</legend>');
105-
$this->assertResponseContains('<input type="text" name="username" required="required" id="username"/>');
106-
$this->assertResponseContains('<input type="password" name="password" required="required" id="password"/>');
105+
$this->assertResponseContains('<input type="text" name="username" required="required" id="username" aria-required="true"/>');
106+
$this->assertResponseContains('<input type="password" name="password" required="required" id="password" aria-required="true"/>');
107107
$this->assertResponseContains('<input type="checkbox" name="remember_me" value="1" checked="checked" id="remember-me">');
108108
$this->assertResponseContains('<button type="submit">Login</button>');
109109
$this->assertResponseContains('<a href="/register">Register</a>');
@@ -131,8 +131,8 @@ public function testLoginPostRequestInvalidPassword()
131131
$this->assertResponseContains('Username or password is incorrect');
132132
$this->assertResponseContains('<form method="post" accept-charset="utf-8" action="/login">');
133133
$this->assertResponseContains('<legend>Please enter your username and password</legend>');
134-
$this->assertResponseContains('<input type="text" name="username" required="required" id="username" value="user-2"/>');
135-
$this->assertResponseContains('<input type="password" name="password" required="required" id="password" value="123456789"/>');
134+
$this->assertResponseContains('<input type="text" name="username" required="required" id="username" aria-required="true" value="user-2"/>');
135+
$this->assertResponseContains('<input type="password" name="password" required="required" id="password" aria-required="true" value="123456789"/>');
136136
$this->assertResponseContains('<input type="checkbox" name="remember_me" value="1" checked="checked" id="remember-me">');
137137
$this->assertResponseContains('<button type="submit">Login</button>');
138138
}

tests/TestCase/Controller/Traits/Integration/RegisterTraitIntegrationTest.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -48,7 +48,7 @@ public function testRegister()
4848
$this->assertResponseContains('<input type="text" name="first_name" id="first-name" maxlength="50"/>');
4949
$this->assertResponseContains('<input type="text" name="last_name" id="last-name" maxlength="50"/>');
5050
$this->assertResponseContains('<input type="hidden" name="tos" value="0"/>');
51-
$this->assertResponseContains('<label for="tos"><input type="checkbox" name="tos" value="1" required="required" id="tos">Accept TOS conditions?</label>');
51+
$this->assertResponseContains('<label for="tos"><input type="checkbox" name="tos" value="1" required="required" id="tos" aria-required="true">Accept TOS conditions?</label>');
5252
$this->assertResponseContains('<button type="submit">Submit</button>');
5353
}
5454

@@ -83,7 +83,7 @@ public function testRegisterPostWithErrors()
8383
$this->assertResponseContains('<input type="text" name="first_name" id="first-name" value="" maxlength="50"/>');
8484
$this->assertResponseContains('<input type="text" name="last_name" id="last-name" value="" maxlength="50"/>');
8585
$this->assertResponseContains('<input type="hidden" name="tos" value="0"/>');
86-
$this->assertResponseContains('<label for="tos"><input type="checkbox" name="tos" value="1" required="required" id="tos">Accept TOS conditions?</label>');
86+
$this->assertResponseContains('<label for="tos"><input type="checkbox" name="tos" value="1" required="required" id="tos" aria-required="true">Accept TOS conditions?</label>');
8787
$this->assertResponseContains('<button type="submit">Submit</button>');
8888
}
8989

tests/TestCase/Controller/Traits/Integration/SimpleCrudTraitIntegrationTest.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -95,9 +95,9 @@ public function testCrud()
9595

9696
$this->get('/users/edit/00000000-0000-0000-0000-000000000006');
9797
$this->assertResponseContains('<input type="text" name="username" required="required');
98-
$this->assertResponseContains('id="username" value="user-6"');
98+
$this->assertResponseContains('id="username" aria-required="true" value="user-6"');
9999
$this->assertResponseContains('<input type="email" name="email" required="required');
100-
$this->assertResponseContains('id="email" value="6@example.com"');
100+
$this->assertResponseContains('id="email" aria-required="true" value="6@example.com"');
101101
$this->assertResponseContains('<input type="text" name="first_name" id="first-name" value="first-user-6');
102102
$this->assertResponseContains('<input type="text" name="last_name" id="last-name" value="firts name 6');
103103
$this->assertResponseContains('<label for="active"><input type="checkbox" name="active" value="1" id="active" checked="checked">Active</label>');

0 commit comments

Comments
 (0)