3 declare(strict_types=1);
19 $first_cid = $generator->getCid();
20 $next_cid = $generator->getCid();
22 $this->assertEquals(
'0', $first_cid);
23 $this->assertNotEquals(
'0', $next_cid);
24 $this->assertEquals(
'1', $next_cid);
30 $first_cid = $generator->getCid();
31 $next_cid = $generator->getCid();
33 $this->assertEquals(
'2s', $first_cid);
34 $this->assertNotEquals(
'2s', $next_cid);
35 $this->assertEquals(
'2t', $next_cid);
41 $first_cid = $generator->getCid();
42 $next_cid = $generator->getCid();
44 $this->assertEquals(
'-2s', $first_cid);
45 $this->assertNotEquals(
'-2s', $next_cid);
46 $this->assertEquals(
'-2r', $next_cid);
53 $this->expectException(TypeError::class);
54 $this->expectExceptionMessage(
'Cannot increment property ilCtrlStructureCidGenerator::$index of type int past its maximal value');
55 $cid = $generator->getCid();
62 $this->assertEquals(99999, $generator->getIndexByCid(
'255r'));
63 $this->assertEquals(-99999, $generator->getIndexByCid(
'-255r'));
64 $this->assertEquals(0, $generator->getIndexByCid(
'0'));
65 $this->assertEquals(0, $generator->getIndexByCid(
'-0'));
66 $this->assertEquals(1, $generator->getIndexByCid(
'1'));
67 $this->assertEquals(-1, $generator->getIndexByCid(
'-1'));
74 $this->assertEquals(
'255r', $generator->getCidByIndex(99999));
75 $this->assertEquals(
'-255r', $generator->getCidByIndex(-99999));
76 $this->assertEquals(
'0', $generator->getCidByIndex(0));
77 $this->assertEquals(
'0', $generator->getCidByIndex(-0));
78 $this->assertEquals(
'1', $generator->getCidByIndex(1));
79 $this->assertEquals(
'-1', $generator->getCidByIndex(-1));
testCidGeneratorContinuousIncrementsFromMaxIntegerValue()
testCidGeneratorNegativeContinuousIncrements()
testCidGeneratorCidByIndexValue()
Class ilCtrlStructureCidGenerator.
testCidGeneratorIncrements()
Class ilCtrlStructureCidGeneratorTest.
testCidGeneratorIndexByCidValue()
testCidGeneratorPositiveContinuousIncrements()