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