ILIAS  release_7 Revision v7.30-3-g800a261c036
RangeTest Class Reference
+ Inheritance diagram for RangeTest:
+ Collaboration diagram for RangeTest:

Public Member Functions

 testFactory ()
 
 testValues (Range $range)
 @depends testFactory More...
 
 testEndCalculation (Range $range)
 @depends testFactory More...
 
 testWithLength (Range $range)
 @depends testFactory More...
 
 testWithStart (Range $range)
 @depends testWithLength More...
 
 testUnpack (Range $range)
 @depends testWithStart More...
 
 testNegativeStart (Range $range)
 @depends testFactory More...
 
 testNegativeLength (Range $range)
 @depends testFactory More...
 
 testNullLength (Range $range)
 @depends testFactory More...
 
 testConstructionWrongStart ()
 
 testConstructionWrongLength ()
 
 testConstructionNullLength ()
 

Detailed Description

Member Function Documentation

◆ testConstructionNullLength()

RangeTest::testConstructionNullLength ( )

Definition at line 112 of file RangeTest.php.

113 {
114 $this->expectException(InvalidArgumentException::class);
115 $f = new ILIAS\Data\Factory();
116 $range = $f->range(1, 0);
117 }
Builds data types.
Definition: Factory.php:20

References Vendor\Package\$f.

◆ testConstructionWrongLength()

RangeTest::testConstructionWrongLength ( )

Definition at line 105 of file RangeTest.php.

106 {
107 $this->expectException(InvalidArgumentException::class);
108 $f = new ILIAS\Data\Factory();
109 $range = $f->range(1, -2);
110 }

References Vendor\Package\$f.

◆ testConstructionWrongStart()

RangeTest::testConstructionWrongStart ( )

Definition at line 98 of file RangeTest.php.

99 {
100 $this->expectException(InvalidArgumentException::class);
101 $f = new ILIAS\Data\Factory();
102 $range = $f->range(-1, 2);
103 }

References Vendor\Package\$f.

◆ testEndCalculation()

RangeTest::testEndCalculation ( Range  $range)

@depends testFactory

Definition at line 31 of file RangeTest.php.

32 {
33 $this->assertEquals(3, $range->getEnd());
34 }

References ILIAS\Data\Range\getEnd().

+ Here is the call graph for this function:

◆ testFactory()

RangeTest::testFactory ( )

Definition at line 11 of file RangeTest.php.

12 {
13 $f = new ILIAS\Data\Factory();
14 $range = $f->range(1, 2);
15 $this->assertInstanceOf(Range::class, $range);
16 return $range;
17 }

References Vendor\Package\$f.

◆ testNegativeLength()

RangeTest::testNegativeLength ( Range  $range)

@depends testFactory

Definition at line 83 of file RangeTest.php.

84 {
85 $this->expectException(InvalidArgumentException::class);
86 $range = $range->withLength(-1);
87 }
withLength(int $length)
Definition: Range.php:73

References ILIAS\Data\Range\withLength().

+ Here is the call graph for this function:

◆ testNegativeStart()

RangeTest::testNegativeStart ( Range  $range)

@depends testFactory

Definition at line 74 of file RangeTest.php.

75 {
76 $this->expectException(InvalidArgumentException::class);
77 $range = $range->withStart(-5);
78 }
withStart(int $start)
Definition: Range.php:65

References ILIAS\Data\Range\withStart().

+ Here is the call graph for this function:

◆ testNullLength()

RangeTest::testNullLength ( Range  $range)

@depends testFactory

Definition at line 92 of file RangeTest.php.

93 {
94 $this->expectException(InvalidArgumentException::class);
95 $range = $range->withLength(0);
96 }

References ILIAS\Data\Range\withLength().

+ Here is the call graph for this function:

◆ testUnpack()

RangeTest::testUnpack ( Range  $range)

@depends testWithStart

Definition at line 63 of file RangeTest.php.

64 {
65 $this->assertEquals(
66 [3,3],
67 $range->unpack()
68 );
69 }

References ILIAS\Data\Range\unpack().

+ Here is the call graph for this function:

◆ testValues()

RangeTest::testValues ( Range  $range)

@depends testFactory

Definition at line 22 of file RangeTest.php.

23 {
24 $this->assertEquals(1, $range->getStart());
25 $this->assertEquals(2, $range->getLength());
26 }

References ILIAS\Data\Range\getLength(), and ILIAS\Data\Range\getStart().

+ Here is the call graph for this function:

◆ testWithLength()

RangeTest::testWithLength ( Range  $range)

@depends testFactory

Definition at line 39 of file RangeTest.php.

40 {
41 $range = $range->withLength(3);
42 $this->assertEquals(1, $range->getStart());
43 $this->assertEquals(3, $range->getLength());
44 $this->assertEquals(4, $range->getEnd());
45 return $range;
46 }

References ILIAS\Data\Range\getEnd(), ILIAS\Data\Range\getLength(), ILIAS\Data\Range\getStart(), and ILIAS\Data\Range\withLength().

+ Here is the call graph for this function:

◆ testWithStart()

RangeTest::testWithStart ( Range  $range)

@depends testWithLength

Definition at line 51 of file RangeTest.php.

52 {
53 $range = $range->withStart(3);
54 $this->assertEquals(3, $range->getStart());
55 $this->assertEquals(3, $range->getLength());
56 $this->assertEquals(6, $range->getEnd());
57 return $range;
58 }

References ILIAS\Data\Range\getEnd(), ILIAS\Data\Range\getLength(), ILIAS\Data\Range\getStart(), and ILIAS\Data\Range\withStart().

+ Here is the call graph for this function:

The documentation for this class was generated from the following file: