コード例 #1
0
         $password = "******";
         $email = "*****@*****.**";
         $firstName = "Gary";
         $lastName = "Grice";
         $this->user1Key = new Uuid();
         $user1 = new User($this->user1Key, $username, $password, $email, $firstName, $lastName);
         $actual->add($user1);
         $returnedUser = $actual->getUser($this->user1Key);
         expect($returnedUser)->to->be->instanceof('Notes\\Domain\\Entity\\User');
         expect($returnedUser->getUserName())->to->equal($user1->getUserName());
     });
 });
 describe('->containsUser($userID)', function () {
     it('should return true if the user is in the database and false if they are not', function () {
         $actual = new MysqlUserRepository();
         expect($actual->containsUser($this->user1Key))->to->equal(true);
         $fakeId = new Uuid();
         expect($actual->containsUser($fakeId))->to->equal(false);
     });
 });
 describe('->modify($userID)', function () {
     it('should modify a user with the ID given with one or more input values', function () {
         $actual = new MysqlUserRepository();
         $passwordU = "OldDannyBrown12\$";
         $emailU = "*****@*****.**";
         $actual->modify($this->user1Key, '', '', $passwordU, $emailU, '');
         $returnedUser = $actual->getUser($this->user1Key);
         expect($returnedUser)->to->be->instanceof('Notes\\Domain\\Entity\\User');
         expect($returnedUser->getEmail())->to->equal($emailU);
     });
 });