Total Complexity | 2 |
Total Lines | 20 |
Duplicated Lines | 0 % |
Changes | 1 | ||
Bugs | 0 | Features | 1 |
1 | <?php |
||
13 | class ClassTest extends CommonTestClass |
||
14 | { |
||
15 | /** |
||
16 | * @throws LockException |
||
17 | */ |
||
18 | public function testInit(): void |
||
19 | { |
||
20 | $lib = $this->getPassLib(); |
||
21 | $lib->setClass(new Memory()); // not need too many things |
||
22 | $this->assertFalse($lib->has()); // nothing now |
||
23 | $this->assertTrue($lib->create()); // new one |
||
24 | $this->assertFalse($lib->create()); // already has |
||
25 | $this->assertTrue($lib->has()); |
||
26 | $this->assertTrue($lib->delete()); // delete current |
||
27 | $this->assertFalse($lib->has()); // nothing here |
||
28 | } |
||
29 | |||
30 | protected function getPassLib(): ClassLock |
||
31 | { |
||
32 | return new ClassLock(new StorageLock(new \XStorage())); |
||
33 | } |
||
35 |