Class ilCtrlStructureCidGeneratorTest.
More...
◆ testCidGeneratorCidByIndexValue()
ilCtrlStructureCidGeneratorTest::testCidGeneratorCidByIndexValue |
( |
| ) |
|
Definition at line 84 of file ilCtrlStructureCidGeneratorTest.php.
84 : void
85 {
87
88 $this->assertEquals('255r', $generator->getCidByIndex(99999));
89 $this->assertEquals('-255r', $generator->getCidByIndex(-99999));
90 $this->assertEquals('0', $generator->getCidByIndex(0));
91 $this->assertEquals('0', $generator->getCidByIndex(-0));
92 $this->assertEquals('1', $generator->getCidByIndex(1));
93 $this->assertEquals('-1', $generator->getCidByIndex(-1));
94 }
Class ilCtrlStructureCidGenerator.
◆ testCidGeneratorContinuousIncrementsFromMaxIntegerValue()
ilCtrlStructureCidGeneratorTest::testCidGeneratorContinuousIncrementsFromMaxIntegerValue |
( |
| ) |
|
Definition at line 63 of file ilCtrlStructureCidGeneratorTest.php.
63 : void
64 {
66
67 $this->expectException(TypeError::class);
68 $this->expectExceptionMessage('Cannot increment property ilCtrlStructureCidGenerator::$index of type int past its maximal value');
69 $cid = $generator->getCid();
70 }
◆ testCidGeneratorIncrements()
ilCtrlStructureCidGeneratorTest::testCidGeneratorIncrements |
( |
| ) |
|
Definition at line 30 of file ilCtrlStructureCidGeneratorTest.php.
30 : void
31 {
33 $first_cid = $generator->getCid();
34 $next_cid = $generator->getCid();
35
36 $this->assertEquals('0', $first_cid);
37 $this->assertNotEquals('0', $next_cid);
38 $this->assertEquals('1', $next_cid);
39 }
◆ testCidGeneratorIndexByCidValue()
ilCtrlStructureCidGeneratorTest::testCidGeneratorIndexByCidValue |
( |
| ) |
|
Definition at line 72 of file ilCtrlStructureCidGeneratorTest.php.
72 : void
73 {
75
76 $this->assertEquals(99999, $generator->getIndexByCid('255r'));
77 $this->assertEquals(-99999, $generator->getIndexByCid('-255r'));
78 $this->assertEquals(0, $generator->getIndexByCid('0'));
79 $this->assertEquals(0, $generator->getIndexByCid('-0'));
80 $this->assertEquals(1, $generator->getIndexByCid('1'));
81 $this->assertEquals(-1, $generator->getIndexByCid('-1'));
82 }
◆ testCidGeneratorNegativeContinuousIncrements()
ilCtrlStructureCidGeneratorTest::testCidGeneratorNegativeContinuousIncrements |
( |
| ) |
|
Definition at line 52 of file ilCtrlStructureCidGeneratorTest.php.
52 : void
53 {
55 $first_cid = $generator->getCid();
56 $next_cid = $generator->getCid();
57
58 $this->assertEquals('-2s', $first_cid);
59 $this->assertNotEquals('-2s', $next_cid);
60 $this->assertEquals('-2r', $next_cid);
61 }
◆ testCidGeneratorPositiveContinuousIncrements()
ilCtrlStructureCidGeneratorTest::testCidGeneratorPositiveContinuousIncrements |
( |
| ) |
|
Definition at line 41 of file ilCtrlStructureCidGeneratorTest.php.
41 : void
42 {
44 $first_cid = $generator->getCid();
45 $next_cid = $generator->getCid();
46
47 $this->assertEquals('2s', $first_cid);
48 $this->assertNotEquals('2s', $next_cid);
49 $this->assertEquals('2t', $next_cid);
50 }
The documentation for this class was generated from the following file: