mirror of
https://github.com/elyby/accounts.git
synced 2025-05-31 14:11:46 +05:30
Implementation of the backend for the OAuth2 clients management
This commit is contained in:
@@ -0,0 +1,33 @@
|
||||
<?php
|
||||
namespace tests\codeception\common\unit\validators;
|
||||
|
||||
use common\validators\MinecraftServerAddressValidator;
|
||||
use tests\codeception\common\unit\TestCase;
|
||||
|
||||
class MinecraftServerAddressValidatorTest extends TestCase {
|
||||
|
||||
/**
|
||||
* @dataProvider domainNames
|
||||
*/
|
||||
public function testValidate($address, $shouldBeValid) {
|
||||
$validator = new MinecraftServerAddressValidator();
|
||||
$validator->validate($address, $errors);
|
||||
$this->assertEquals($shouldBeValid, $errors === null);
|
||||
}
|
||||
|
||||
public function domainNames() {
|
||||
return [
|
||||
['localhost', true ],
|
||||
['localhost:25565', true ],
|
||||
['mc.hypixel.net', true ],
|
||||
['mc.hypixel.net:25565', true ],
|
||||
['136.243.88.97', true ],
|
||||
['136.243.88.97:25565', true ],
|
||||
['http://ely.by', false],
|
||||
['http://ely.by:80', false],
|
||||
['ely.by/abcd', false],
|
||||
['ely.by?abcd', false],
|
||||
];
|
||||
}
|
||||
|
||||
}
|
Reference in New Issue
Block a user