1
0
Fork 0
mirror of synced 2024-09-08 05:42:15 +12:00
appwrite/tests/unit/Utopia/Request/Filters/V17Test.php
2024-01-22 11:23:23 +00:00

56 lines
1.2 KiB
PHP

<?php
namespace Tests\Unit\Utopia\Request\Filters;
use Appwrite\Utopia\Request\Filter;
use Appwrite\Utopia\Request\Filters\V17;
use PHPUnit\Framework\TestCase;
class V17Test extends TestCase
{
/**
* @var Filter
*/
protected $filter;
public function setUp(): void
{
$this->filter = new V17();
}
public function tearDown(): void
{
}
public function createUpdateRecoveryProvider()
{
return [
'remove passwordAgain' => [
[
'userId' => 'test',
'secret' => 'test',
'password' => '123456',
'passwordAgain' => '123456'
],
[
'userId' => 'test',
'secret' => 'test',
'password' => '123456',
]
]
];
}
/**
* @dataProvider createUpdateRecoveryProvider
*/
public function testUpdateRecovery(array $content, array $expected): void
{
$model = 'account.updateRecovery';
$result = $this->filter->parse($content, $model);
$this->assertEquals($expected, $result);
}
}