Skip to content

Commit 64c4e98

Browse files
committed
Adjust UserControllerTest to match new DataFixture state
1 parent 53ae11e commit 64c4e98

1 file changed

Lines changed: 10 additions & 3 deletions

File tree

tests/Functional/UserControllerTest.php

Lines changed: 10 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ public function testUserIndex(): void
2020
$this->assertSelectorExists('nav.navbar');
2121
$this->assertSelectorTextContains('h1', 'Users and Resources');
2222
$this->assertSelectorTextContains('a.btn', '+ New User');
23-
$this->assertSelectorTextContains('h5', 'Test User');
23+
$this->assertAnySelectorTextContains('h5', 'Test User');
2424
}
2525

2626
public function testUserEdit(): void
@@ -41,7 +41,7 @@ public function testUserEdit(): void
4141
$this->assertResponseRedirects('/users/');
4242
$client->followRedirect();
4343

44-
$this->assertSelectorTextContains('h5', 'Test User');
44+
$this->assertAnySelectorTextContains('h5', 'Test User');
4545
}
4646

4747
public function testUserNew(): void
@@ -72,7 +72,7 @@ public function testUserNew(): void
7272
$this->assertResponseRedirects('/users/');
7373
$client->followRedirect();
7474

75-
$this->assertSelectorTextContains('h5', 'Test User');
75+
$this->assertAnySelectorTextContains('h5', 'Test User');
7676
$this->assertAnySelectorTextContains('h5', 'New test User');
7777
}
7878

@@ -87,6 +87,13 @@ public function testUserDelete(): void
8787
$this->assertResponseRedirects('/users/');
8888
$client->followRedirect();
8989

90+
$this->assertAnySelectorTextContains('h5', 'Test User 2');
91+
92+
$client->request('GET', '/users/delete/test_user2');
93+
94+
$this->assertResponseRedirects('/users/');
95+
$client->followRedirect();
96+
9097
$this->assertSelectorTextContains('div#no-user', 'No users yet.');
9198
}
9299

0 commit comments

Comments
 (0)