mirror of
https://github.com/RSS-Bridge/rss-bridge.git
synced 2025-07-30 21:30:14 +02:00
refactor (#3712)
* test: refactor test suite * docs * refactor * yup * docs
This commit is contained in:
40
tests/ParameterValidatorTest.php
Normal file
40
tests/ParameterValidatorTest.php
Normal file
@@ -0,0 +1,40 @@
|
||||
<?php
|
||||
|
||||
declare(strict_types=1);
|
||||
|
||||
namespace RssBridge\Tests;
|
||||
|
||||
use PHPUnit\Framework\TestCase;
|
||||
|
||||
class ParameterValidatorTest extends TestCase
|
||||
{
|
||||
public function test1()
|
||||
{
|
||||
$sut = new \ParameterValidator();
|
||||
$input = ['user' => 'joe'];
|
||||
$parameters = [
|
||||
[
|
||||
'user' => [
|
||||
'name' => 'User',
|
||||
'type' => 'text',
|
||||
],
|
||||
]
|
||||
];
|
||||
$this->assertTrue($sut->validateInput($input, $parameters));
|
||||
}
|
||||
|
||||
public function test2()
|
||||
{
|
||||
$sut = new \ParameterValidator();
|
||||
$input = ['username' => 'joe'];
|
||||
$parameters = [
|
||||
[
|
||||
'user' => [
|
||||
'name' => 'User',
|
||||
'type' => 'text',
|
||||
],
|
||||
]
|
||||
];
|
||||
$this->assertFalse($sut->validateInput($input, $parameters));
|
||||
}
|
||||
}
|
Reference in New Issue
Block a user