rss-bridge/tests/ParameterValidatorTest.php
Dag 41df17bc46
refactor (#3712)
* test: refactor test suite

* docs

* refactor

* yup

* docs
2023-10-01 19:23:30 +02:00

40 lines
896 B
PHP

<?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));
}
}