Class ilCtrlStructureCidGeneratorTest.
More...
◆ testCidGeneratorCidByIndexValue()
| ilCtrlStructureCidGeneratorTest::testCidGeneratorCidByIndexValue |
( |
| ) |
|
Definition at line 70 of file ilCtrlStructureCidGeneratorTest.php.
70 : void
71 {
73
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));
80 }
Class ilCtrlStructureCidGenerator.
◆ testCidGeneratorContinuousIncrementsFromMaxIntegerValue()
| ilCtrlStructureCidGeneratorTest::testCidGeneratorContinuousIncrementsFromMaxIntegerValue |
( |
| ) |
|
Definition at line 49 of file ilCtrlStructureCidGeneratorTest.php.
49 : void
50 {
52
53 $this->expectException(TypeError::class);
54 $this->expectExceptionMessage('Cannot increment property ilCtrlStructureCidGenerator::$index of type int past its maximal value');
55 $cid = $generator->getCid();
56 }
◆ testCidGeneratorIncrements()
| ilCtrlStructureCidGeneratorTest::testCidGeneratorIncrements |
( |
| ) |
|
Definition at line 16 of file ilCtrlStructureCidGeneratorTest.php.
16 : void
17 {
19 $first_cid = $generator->getCid();
20 $next_cid = $generator->getCid();
21
22 $this->assertEquals('0', $first_cid);
23 $this->assertNotEquals('0', $next_cid);
24 $this->assertEquals('1', $next_cid);
25 }
◆ testCidGeneratorIndexByCidValue()
| ilCtrlStructureCidGeneratorTest::testCidGeneratorIndexByCidValue |
( |
| ) |
|
Definition at line 58 of file ilCtrlStructureCidGeneratorTest.php.
58 : void
59 {
61
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'));
68 }
◆ testCidGeneratorNegativeContinuousIncrements()
| ilCtrlStructureCidGeneratorTest::testCidGeneratorNegativeContinuousIncrements |
( |
| ) |
|
Definition at line 38 of file ilCtrlStructureCidGeneratorTest.php.
38 : void
39 {
41 $first_cid = $generator->getCid();
42 $next_cid = $generator->getCid();
43
44 $this->assertEquals('-2s', $first_cid);
45 $this->assertNotEquals('-2s', $next_cid);
46 $this->assertEquals('-2r', $next_cid);
47 }
◆ testCidGeneratorPositiveContinuousIncrements()
| ilCtrlStructureCidGeneratorTest::testCidGeneratorPositiveContinuousIncrements |
( |
| ) |
|
Definition at line 27 of file ilCtrlStructureCidGeneratorTest.php.
27 : void
28 {
30 $first_cid = $generator->getCid();
31 $next_cid = $generator->getCid();
32
33 $this->assertEquals('2s', $first_cid);
34 $this->assertNotEquals('2s', $next_cid);
35 $this->assertEquals('2t', $next_cid);
36 }
The documentation for this class was generated from the following file: