Class ilCtrlStructureCidGeneratorTest.
More...
◆ testCidGeneratorCidByIndexValue()
ilCtrlStructureCidGeneratorTest::testCidGeneratorCidByIndexValue |
( |
| ) |
|
Definition at line 84 of file ilCtrlStructureCidGeneratorTest.php.
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));
Class ilCtrlStructureCidGenerator.
◆ testCidGeneratorContinuousIncrementsFromMaxIntegerValue()
ilCtrlStructureCidGeneratorTest::testCidGeneratorContinuousIncrementsFromMaxIntegerValue |
( |
| ) |
|
Definition at line 63 of file ilCtrlStructureCidGeneratorTest.php.
67 $this->expectException(TypeError::class);
68 $this->expectExceptionMessage(
'Cannot increment property ilCtrlStructureCidGenerator::$index of type int past its maximal value');
69 $cid = $generator->getCid();
Class ilCtrlStructureCidGenerator.
◆ testCidGeneratorIncrements()
ilCtrlStructureCidGeneratorTest::testCidGeneratorIncrements |
( |
| ) |
|
Definition at line 30 of file ilCtrlStructureCidGeneratorTest.php.
33 $first_cid = $generator->getCid();
34 $next_cid = $generator->getCid();
36 $this->assertEquals(
'0', $first_cid);
37 $this->assertNotEquals(
'0', $next_cid);
38 $this->assertEquals(
'1', $next_cid);
Class ilCtrlStructureCidGenerator.
◆ testCidGeneratorIndexByCidValue()
ilCtrlStructureCidGeneratorTest::testCidGeneratorIndexByCidValue |
( |
| ) |
|
Definition at line 72 of file ilCtrlStructureCidGeneratorTest.php.
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'));
Class ilCtrlStructureCidGenerator.
◆ testCidGeneratorNegativeContinuousIncrements()
ilCtrlStructureCidGeneratorTest::testCidGeneratorNegativeContinuousIncrements |
( |
| ) |
|
Definition at line 52 of file ilCtrlStructureCidGeneratorTest.php.
55 $first_cid = $generator->getCid();
56 $next_cid = $generator->getCid();
58 $this->assertEquals(
'-2s', $first_cid);
59 $this->assertNotEquals(
'-2s', $next_cid);
60 $this->assertEquals(
'-2r', $next_cid);
Class ilCtrlStructureCidGenerator.
◆ testCidGeneratorPositiveContinuousIncrements()
ilCtrlStructureCidGeneratorTest::testCidGeneratorPositiveContinuousIncrements |
( |
| ) |
|
Definition at line 41 of file ilCtrlStructureCidGeneratorTest.php.
44 $first_cid = $generator->getCid();
45 $next_cid = $generator->getCid();
47 $this->assertEquals(
'2s', $first_cid);
48 $this->assertNotEquals(
'2s', $next_cid);
49 $this->assertEquals(
'2t', $next_cid);
Class ilCtrlStructureCidGenerator.
The documentation for this class was generated from the following file: