ILIAS
release_8 Revision v8.23
◀ ilDoc Overview
PositiveIntegerTest.php
Go to the documentation of this file.
1
<?php
2
3
declare(strict_types=1);
4
5
/* Copyright (c) 1998-2019 ILIAS open source, Extended GPL, see docs/LICENSE */
6
11
namespace
ILIAS\Data
;
12
13
use
ILIAS\Refinery\ConstraintViolationException
;
14
use
PHPUnit\Framework\TestCase
;
15
16
require_once(
"libs/composer/vendor/autoload.php"
);
17
18
class
PositiveIntegerTest
extends
TestCase
19
{
23
public
function
testCreatePositiveInteger
(): void
24
{
25
$integer =
new
PositiveInteger
(6);
26
$this->assertSame(6, $integer->getValue());
27
}
28
29
public
function
testNegativeIntegerThrowsException
(): void
30
{
31
$this->expectNotToPerformAssertions();
32
33
try
{
34
$integer =
new
PositiveInteger
(-6);
35
}
catch
(
ConstraintViolationException
$exception) {
36
return
;
37
}
38
$this->fail();
39
}
40
44
public
function
testMaximumIntegerIsAccepted
(): void
45
{
46
$integer =
new
PositiveInteger
(PHP_INT_MAX);
47
$this->assertSame(PHP_INT_MAX, $integer->getValue());
48
}
49
}
ILIAS\Data\PositiveIntegerTest\testCreatePositiveInteger
testCreatePositiveInteger()
Definition:
PositiveIntegerTest.php:23
ILIAS\Data\PositiveIntegerTest
Definition:
PositiveIntegerTest.php:18
ILIAS\Data\PositiveIntegerTest\testNegativeIntegerThrowsException
testNegativeIntegerThrowsException()
Definition:
PositiveIntegerTest.php:29
ILIAS\Data\PositiveInteger
Definition:
PositiveInteger.php:15
ILIAS\Refinery\ConstraintViolationException
Definition:
ConstraintViolationException.php:29
ILIAS\Data\PositiveIntegerTest\testMaximumIntegerIsAccepted
testMaximumIntegerIsAccepted()
Definition:
PositiveIntegerTest.php:44
TestCase
ConstraintViolationException
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...
ILIAS\Data
Definition:
Alphanumeric.php:11
tests
Data
PositiveIntegerTest.php
Generated on Wed Sep 3 2025 22:03:00 for ILIAS by
1.8.13 (using
Doxyfile
)