mirror of
https://github.com/OPSnet/Gazelle.git
synced 2026-01-17 03:04:47 -05:00
22 lines
743 B
PHP
22 lines
743 B
PHP
<?php
|
|
|
|
namespace Gazelle;
|
|
|
|
use PHPUnit\Framework\TestCase;
|
|
|
|
class ClientWhitelistTest extends TestCase {
|
|
public function testWhitelist(): void {
|
|
$manager = new Manager\ClientWhitelist();
|
|
$initial = $manager->list();
|
|
$this->assertGreaterThanOrEqual(0, count($initial), 'cwl-initial');
|
|
|
|
$id = $manager->create('&pu', 'PHPUnit');
|
|
$this->assertGreaterThan(0, $id, 'cwl-id');
|
|
$this->assertCount(count($initial) + 1, $manager->list(), 'cwl-new-list');
|
|
$this->assertEquals('&pu', $manager->peerId($id), 'cwl-peerid');
|
|
|
|
$this->assertEquals('&pu', $manager->modify($id, '&puA', 'PHPUnit-A'), 'cwl-modify');
|
|
$this->assertEquals(1, $manager->remove($id), 'cwl-remove');
|
|
}
|
|
}
|