ILIAS
trunk Revision v12.0_alpha-1540-g00f839d5fa1
◀ ilDoc Overview
PositiveIntegerTest.php
Go to the documentation of this file.
1
<?php
2
19
declare(strict_types=1);
20
25
namespace
ILIAS\Data
;
26
27
use
ILIAS\Refinery\ConstraintViolationException
;
28
use PHPUnit\Framework\TestCase;
29
30
require_once(
"vendor/composer/vendor/autoload.php"
);
31
32
class
PositiveIntegerTest
extends
TestCase
33
{
37
public
function
testCreatePositiveInteger
(): void
38
{
39
$integer =
new
PositiveInteger
(6);
40
$this->assertSame(6, $integer->getValue());
41
}
42
43
public
function
testNegativeIntegerThrowsException
(): void
44
{
45
$this->expectNotToPerformAssertions();
46
47
try
{
48
$integer =
new
PositiveInteger
(-6);
49
}
catch
(
ConstraintViolationException
$exception) {
50
return
;
51
}
52
$this->fail();
53
}
54
58
public
function
testMaximumIntegerIsAccepted
(): void
59
{
60
$integer =
new
PositiveInteger
(PHP_INT_MAX);
61
$this->assertSame(PHP_INT_MAX, $integer->getValue());
62
}
63
}
ILIAS\Data\PositiveIntegerTest
Definition:
PositiveIntegerTest.php:33
ILIAS\Data\PositiveIntegerTest\testMaximumIntegerIsAccepted
testMaximumIntegerIsAccepted()
Definition:
PositiveIntegerTest.php:58
ILIAS\Data\PositiveIntegerTest\testNegativeIntegerThrowsException
testNegativeIntegerThrowsException()
Definition:
PositiveIntegerTest.php:43
ILIAS\Data\PositiveIntegerTest\testCreatePositiveInteger
testCreatePositiveInteger()
Definition:
PositiveIntegerTest.php:37
ILIAS\Data\PositiveInteger
Definition:
PositiveInteger.php:30
ILIAS\Refinery\ConstraintViolationException
Definition:
ConstraintViolationException.php:30
ILIAS\Data
Definition:
Alphanumeric.php:25
components
ILIAS
Data
tests
PositiveIntegerTest.php
Generated on Wed Jun 3 2026 23:04:36 for ILIAS by
1.9.4 (using
Doxyfile
)