FOS\UserBundle\Tests\Command\CreateUserCommandTest::testUserCreation PHP Method

testUserCreation() public method

public testUserCreation ( )
    public function testUserCreation()
    {
        $kernel = $this->createKernel();
        $command = new CreateUserCommand();
        $application = new Application($kernel);
        $application->setAutoExit(false);
        $tester = new ApplicationTester($application);
        $username = 'test_username';
        $password = 'test_password';
        $email = '[email protected]';
        $tester->run(array('command' => $command->getFullName(), 'username' => $username, 'password' => $password, 'email' => $email), array('interactive' => false, 'decorated' => false, 'verbosity' => Output::VERBOSITY_VERBOSE));
        $userManager = $this->getService('fos_user.user_manager');
        $user = $userManager->findUserByUsername($username);
        $this->assertTrue($user instanceof User);
        $this->assertEquals($email, $user->getEmail());
        $userManager->deleteUser($user);
    }