// Create a new user in the database
$crawler = $client->request('GET', '/users/');
- $this->assertEquals(200, $client->getResponse()->getStatusCode(), "Unexpected HTTP status code for GET /users/");
+ $this->assertEquals(200, $client->getResponse()->getStatusCode(), 'Unexpected HTTP status code for GET /users/');
$crawler = $client->click($crawler->selectLink('user.list.create_new_one')->link());
// Fill in the form and submit it
'user[username]' => 'test_user',
'user[email]' => 'test@test.io',
'user[enabled]' => true,
- 'user[locked]' => false,
));
$client->submit($form);
// Check the user has been delete on the list
$this->assertNotRegExp('/Foo User/', $client->getResponse()->getContent());
}
+
+ public function testDeleteDisabledForLoggedUser()
+ {
+ $this->logInAs('admin');
+ $client = $this->getClient();
+
+ $crawler = $client->request('GET', '/users/'.$this->getLoggedInUserId().'/edit');
+ $disabled = $crawler->selectButton('user.form.delete')->extract('disabled');
+
+ $this->assertEquals('disabled', $disabled[0]);
+ }
}