private function PatternsUserTestCase::testUserCreate in Patterns 7.2
Same name and namespace in other branches
- 7 tests/user/user.test \PatternsUserTestCase::testUserCreate()
File
- tests/user/user.test, line 195
- SimpleTests for the User component of Patterns.
TODO: permissions.
Class
- PatternsUserTestCase
- @file
SimpleTests for the User component of Patterns.
TODO: permissions.
Code
private function testUserCreate() {
$user_count = db_select('users', 'u')
->fields('u', array(
'uid',
))
->condition('name', 'test_uid')
->countQuery()
->execute()
->fetchField();
$this
->assertIdentical($user_count, '0', t('The user should not exist at this point.'));
parent::runFile('user_create.yaml', 'Users (create)', $this->user_tests_dir);
$this
->assertUniqueText(t('Created a new user account for test_uid.'));
$user = db_select('users', 'u')
->fields('u', array(
'uid',
))
->condition('name', 'test_uid')
->countQuery()
->execute()
->fetchField();
$this
->verbose('usercount: ' . $user);
$this
->assertIdentical($user, 1, t('The test user should exist at this point.'));
}