ILIAS
release_6 Revision v6.24-5-g0c8bfefb3b8
◀ ilDoc Overview
Main Page
Related Pages
Modules
+
Namespaces
Namespace List
+
Namespace Members
+
All
$
_
a
b
c
d
e
f
g
h
i
j
l
m
p
s
t
w
+
Functions
_
a
b
c
f
g
h
i
s
t
w
+
Variables
$
c
d
e
f
g
h
j
l
m
p
s
t
+
Data Structures
Data Structures
Data Structure Index
Class Hierarchy
+
Data Fields
+
All
$
_
a
b
c
d
e
f
g
h
i
j
k
l
m
n
o
p
q
r
s
t
u
v
w
x
y
z
+
Functions
_
a
b
c
d
e
f
g
h
i
j
k
l
m
n
o
p
q
r
s
t
u
v
w
x
y
z
+
Variables
$
a
b
c
d
e
f
g
h
i
j
k
l
m
n
o
p
q
r
s
t
u
v
w
x
y
z
+
Files
File List
+
Globals
+
All
$
_
a
b
c
d
e
f
g
h
i
j
k
l
m
n
o
p
q
r
s
t
u
v
w
x
z
+
Functions
_
a
b
c
d
e
f
g
h
i
l
m
n
o
p
r
s
t
u
v
w
x
+
Variables
$
a
b
c
d
e
f
g
h
i
j
k
l
m
n
o
p
q
r
s
t
u
v
w
x
z
Examples
•
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
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 Sat Apr 5 2025 20:01:40 for ILIAS by
1.8.13 (using
Doxyfile
)