ILIAS  release_6 Revision v6.24-5-g0c8bfefb3b8
All Data Structures Namespaces Files Functions Variables Modules Pages
PositiveIntegerTest.php
Go to the documentation of this file.
1 <?php
2 /* Copyright (c) 1998-2019 ILIAS open source, Extended GPL, see docs/LICENSE */
3 
8 namespace ILIAS\Data;
9 
12 
13 require_once("libs/composer/vendor/autoload.php");
14 
16 {
20  public function testCreatePositiveInteger()
21  {
22  $integer = new PositiveInteger(6);
23  $this->assertSame(6, $integer->getValue());
24  }
25 
27  {
28  $this->expectNotToPerformAssertions();
29 
30  try {
31  $integer = new PositiveInteger(-6);
32  } catch (ConstraintViolationException $exception) {
33  return;
34  }
35  $this->fail();
36  }
37 
41  public function testMaximumIntegerIsAccepted()
42  {
43  $integer = new PositiveInteger(PHP_INT_MAX);
44  $this->assertSame(PHP_INT_MAX, $integer->getValue());
45  }
46 }