1: <?php
2: namespace tests\unit\lib;
3:
4: use barebones\lib\security\BrowserIdentification;
5: use tests\unit\BaseUnitTestCase;
6:
7: class BrowserIdentificationTest extends BaseUnitTestCase
8: {
9: public function testGeneratesIdOnce()
10: {
11: $_COOKIE = array();
12: $this->assertEmpty(BrowserIdentification::getID());
13: BrowserIdentification::generateId("12345");
14: $id = BrowserIdentification::getID();
15: $this->assertNotEmpty($id);
16: BrowserIdentification::generateId("12345");
17: $this->assertEquals($id, BrowserIdentification::getID());
18: }
19: }
20: