[ Avaa Bypassed ]




Upload:

Command:

hmhc3928@18.119.122.145: ~ $
<?php
declare(strict_types=1);

namespace PhpList\Core\Tests\Unit\Security;

use PhpList\Core\Security\HashGenerator;
use PHPUnit\Framework\TestCase;

/**
 * Testcase.
 *
 * @author Oliver Klee <oliver@phplist.com>
 */
class HashGeneratorTest extends TestCase
{
    /**
     * @var HashGenerator
     */
    private $subject = null;

    protected function setUp()
    {
        $this->subject = new HashGenerator();
    }

    /**
     * @test
     */
    public function createPasswordHashCreates32ByteHash()
    {
        static::assertRegExp('/^[a-z0-9]{64}$/', $this->subject->createPasswordHash('Portal'));
    }

    /**
     * @test
     */
    public function createPasswordHashCalledTwoTimesWithSamePasswordCreatesSameHash()
    {
        $password = 'Aperture Science';

        static::assertSame(
            $this->subject->createPasswordHash($password),
            $this->subject->createPasswordHash($password)
        );
    }

    /**
     * @test
     */
    public function createPasswordHashCalledTwoTimesWithDifferentPasswordsCreatesDifferentHashes()
    {
        static::assertNotSame(
            $this->subject->createPasswordHash('Mel'),
            $this->subject->createPasswordHash('Cave Johnson')
        );
    }
}

Filemanager

Name Type Size Permission Actions
AuthenticationTest.php File 3.22 KB 0644
HashGeneratorTest.php File 1.22 KB 0644