Class ilCtrlStructureCidGeneratorTest.
More...
◆ testCidGeneratorCidByIndexValue()
ilCtrlStructureCidGeneratorTest::testCidGeneratorCidByIndexValue |
( |
| ) |
|
Definition at line 70 of file ilCtrlStructureCidGeneratorTest.php.
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));
Class ilCtrlStructureCidGenerator.
◆ testCidGeneratorContinuousIncrementsFromMaxIntegerValue()
ilCtrlStructureCidGeneratorTest::testCidGeneratorContinuousIncrementsFromMaxIntegerValue |
( |
| ) |
|
Definition at line 49 of file ilCtrlStructureCidGeneratorTest.php.
53 $this->expectException(TypeError::class);
54 $this->expectExceptionMessage(
'Cannot increment property ilCtrlStructureCidGenerator::$index of type int past its maximal value');
55 $cid = $generator->getCid();
Class ilCtrlStructureCidGenerator.
◆ testCidGeneratorIncrements()
ilCtrlStructureCidGeneratorTest::testCidGeneratorIncrements |
( |
| ) |
|
Definition at line 16 of file ilCtrlStructureCidGeneratorTest.php.
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);
Class ilCtrlStructureCidGenerator.
◆ testCidGeneratorIndexByCidValue()
ilCtrlStructureCidGeneratorTest::testCidGeneratorIndexByCidValue |
( |
| ) |
|
Definition at line 58 of file ilCtrlStructureCidGeneratorTest.php.
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'));
Class ilCtrlStructureCidGenerator.
◆ testCidGeneratorNegativeContinuousIncrements()
ilCtrlStructureCidGeneratorTest::testCidGeneratorNegativeContinuousIncrements |
( |
| ) |
|
Definition at line 38 of file ilCtrlStructureCidGeneratorTest.php.
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);
Class ilCtrlStructureCidGenerator.
◆ testCidGeneratorPositiveContinuousIncrements()
ilCtrlStructureCidGeneratorTest::testCidGeneratorPositiveContinuousIncrements |
( |
| ) |
|
Definition at line 27 of file ilCtrlStructureCidGeneratorTest.php.
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);
Class ilCtrlStructureCidGenerator.
The documentation for this class was generated from the following file: