ILIAS
release_7 Revision v7.30-3-g800a261c036
◀ ilDoc Overview
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
10
use
ILIAS\Refinery\ConstraintViolationException
;
11
use
PHPUnit\Framework\TestCase
;
12
13
require_once(
"libs/composer/vendor/autoload.php"
);
14
15
class
PositiveIntegerTest
extends
TestCase
16
{
20
public
function
testCreatePositiveInteger
()
21
{
22
$integer =
new
PositiveInteger
(6);
23
$this->assertSame(6, $integer->getValue());
24
}
25
26
public
function
testNegativeIntegerThrowsException
()
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
}
ILIAS\Data\PositiveIntegerTest\testCreatePositiveInteger
testCreatePositiveInteger()
Definition:
PositiveIntegerTest.php:20
ILIAS\Data\PositiveIntegerTest
Definition:
PositiveIntegerTest.php:15
ILIAS\Data\PositiveIntegerTest\testNegativeIntegerThrowsException
testNegativeIntegerThrowsException()
Definition:
PositiveIntegerTest.php:26
ILIAS\Data\PositiveInteger
Definition:
PositiveInteger.php:13
ILIAS\Refinery\ConstraintViolationException
Definition:
ConstraintViolationException.php:14
ILIAS\Data\PositiveIntegerTest\testMaximumIntegerIsAccepted
testMaximumIntegerIsAccepted()
Definition:
PositiveIntegerTest.php:41
TestCase
ConstraintViolationException
ILIAS\Data
Definition:
Alphanumeric.php:10
tests
Data
PositiveIntegerTest.php
Generated on Sun Aug 31 2025 21:01:41 for ILIAS by
1.8.13 (using
Doxyfile
)