PHP Classes

File: tests/Struct/UserTest.php

Recommend this page to a friend!
  Classes of Scott Arciszewski   Discretion   tests/Struct/UserTest.php   Download  
File: tests/Struct/UserTest.php
Role: Class source
Content type: text/plain
Description: Class source
Class: Discretion
Show contact forms and deliver encrypted mail
Author: By
Last change:
Date: 3 years ago
Size: 637 bytes
 

Contents

Class file image Download
<?php
declare(strict_types=1);
namespace
ParagonIE\Discretion\Tests\Struct;

use
ParagonIE\Discretion\Data\HiddenString;
use
ParagonIE\Discretion\Struct\User;
use
PHPUnit\Framework\TestCase;

class
UserTest extends TestCase
{
   
/**
     * @covers User::checkPassword()
     * @covers User::setPassword()
     */
   
public function testPassword()
    {
       
$user = new User();
       
$password = new HiddenString(\random_bytes(32));

       
$user->setPassword($password);

       
$this->assertTrue($user->checkPassword($password));
       
$this->assertFalse($user->checkPassword(new HiddenString(\random_bytes(33))));
    }


}