public function testAddUser()
{
$user = ['username' => 'yeliparra', 'password' => '123', 'email' => '[email protected]', 'active' => 1];
$this->Shell->expects($this->never())->method('_generateRandomUsername');
$this->Shell->expects($this->never())->method('_generateRandomPassword');
$this->Shell->Users->expects($this->once())->method('generateUniqueUsername')->with($user['username'])->will($this->returnValue($user['username']));
$entityUser = $this->Users->newEntity($user);
$this->Shell->Users->expects($this->once())->method('newEntity')->with($user)->will($this->returnValue($entityUser));
$userSaved = $entityUser;
$userSaved->id = 'my-id';
$this->Shell->Users->expects($this->once())->method('save')->with($entityUser)->will($this->returnValue($userSaved));
$this->Shell->runCommand(['addUser', '--username=' . $user['username'], '--password=' . $user['password'], '--email=' . $user['email']]);
}