1
0
Fork 0
mirror of synced 2024-05-19 20:22:33 +12:00
appwrite/tests/unit/Auth/Validator/PasswordTest.php

39 lines
1.1 KiB
PHP
Raw Normal View History

2019-12-29 05:37:39 +13:00
<?php
namespace Appwrite\Tests;
use Appwrite\Auth\Validator\Password;
2019-12-29 05:37:39 +13:00
use PHPUnit\Framework\TestCase;
class PasswordTest extends TestCase
2019-12-29 05:37:39 +13:00
{
/**
* @var Password
*/
protected $object = null;
2020-10-01 10:48:21 +13:00
public function setUp(): void
2019-12-29 05:37:39 +13:00
{
$this->object = new Password();
}
2020-10-01 10:48:21 +13:00
public function tearDown(): void
2019-12-29 05:37:39 +13:00
{
}
public function testValues()
{
2019-12-29 05:44:01 +13:00
$this->assertEquals($this->object->isValid(false), false);
$this->assertEquals($this->object->isValid(null), false);
$this->assertEquals($this->object->isValid(''), false);
2019-12-29 05:37:39 +13:00
$this->assertEquals($this->object->isValid('1'), false);
$this->assertEquals($this->object->isValid('12'), false);
$this->assertEquals($this->object->isValid('123'), false);
$this->assertEquals($this->object->isValid('1234'), false);
$this->assertEquals($this->object->isValid('12345'), false);
2021-11-26 11:31:18 +13:00
$this->assertEquals($this->object->isValid('123456'), false);
$this->assertEquals($this->object->isValid('1234567'), false);
2019-12-29 05:37:39 +13:00
$this->assertEquals($this->object->isValid('WUnOZcn0piQMN8Mh31xw4KQPF0gcNGVA'), true);
}
2020-10-01 10:48:21 +13:00
}