ILIAS  release_7 Revision v7.30-3-g800a261c036
All Data Structures Namespaces Files Functions Variables Modules Pages
RangeTest Class Reference
+ Inheritance diagram for RangeTest:
+ Collaboration diagram for RangeTest:

Public Member Functions

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

Detailed Description

Member Function Documentation

◆ testConstructionNullLength()

RangeTest::testConstructionNullLength ( )

Definition at line 112 of file RangeTest.php.

References Vendor\Package\$f.

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

◆ testConstructionWrongLength()

RangeTest::testConstructionWrongLength ( )

Definition at line 105 of file RangeTest.php.

References Vendor\Package\$f.

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

◆ testConstructionWrongStart()

RangeTest::testConstructionWrongStart ( )

Definition at line 98 of file RangeTest.php.

References Vendor\Package\$f.

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

◆ testEndCalculation()

RangeTest::testEndCalculation ( Range  $range)

testFactory

Definition at line 31 of file RangeTest.php.

References ILIAS\Data\Range\getEnd().

32  {
33  $this->assertEquals(3, $range->getEnd());
34  }
+ Here is the call graph for this function:

◆ testFactory()

RangeTest::testFactory ( )

Definition at line 11 of file RangeTest.php.

References Vendor\Package\$f.

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

◆ testNegativeLength()

RangeTest::testNegativeLength ( Range  $range)

testFactory

Definition at line 83 of file RangeTest.php.

References ILIAS\Data\Range\withLength().

84  {
85  $this->expectException(InvalidArgumentException::class);
86  $range = $range->withLength(-1);
87  }
withLength(int $length)
Definition: Range.php:73
+ Here is the call graph for this function:

◆ testNegativeStart()

RangeTest::testNegativeStart ( Range  $range)

testFactory

Definition at line 74 of file RangeTest.php.

References ILIAS\Data\Range\withStart().

75  {
76  $this->expectException(InvalidArgumentException::class);
77  $range = $range->withStart(-5);
78  }
withStart(int $start)
Definition: Range.php:65
+ Here is the call graph for this function:

◆ testNullLength()

RangeTest::testNullLength ( Range  $range)

testFactory

Definition at line 92 of file RangeTest.php.

References ILIAS\Data\Range\withLength().

93  {
94  $this->expectException(InvalidArgumentException::class);
95  $range = $range->withLength(0);
96  }
withLength(int $length)
Definition: Range.php:73
+ Here is the call graph for this function:

◆ testUnpack()

RangeTest::testUnpack ( Range  $range)

testWithStart

Definition at line 63 of file RangeTest.php.

References ILIAS\Data\Range\unpack().

64  {
65  $this->assertEquals(
66  [3,3],
67  $range->unpack()
68  );
69  }
+ Here is the call graph for this function:

◆ testValues()

RangeTest::testValues ( Range  $range)

testFactory

Definition at line 22 of file RangeTest.php.

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

23  {
24  $this->assertEquals(1, $range->getStart());
25  $this->assertEquals(2, $range->getLength());
26  }
+ Here is the call graph for this function:

◆ testWithLength()

RangeTest::testWithLength ( Range  $range)

testFactory

Definition at line 39 of file RangeTest.php.

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

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  }
withLength(int $length)
Definition: Range.php:73
+ Here is the call graph for this function:

◆ testWithStart()

RangeTest::testWithStart ( Range  $range)

testWithLength

Definition at line 51 of file RangeTest.php.

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

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  }
withStart(int $start)
Definition: Range.php:65
+ Here is the call graph for this function:

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