ILIAS
release_8 Revision v8.19
◀ 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
n
o
p
r
s
t
u
v
w
x
+
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
j
l
m
p
s
t
u
+
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
r
s
t
u
v
w
x
z
+
Functions
_
a
b
c
d
e
g
h
i
m
n
p
r
s
t
u
v
x
+
Variables
$
a
c
d
e
f
g
h
i
j
k
l
m
n
o
p
r
s
t
u
v
w
z
Examples
•
All
Data Structures
Namespaces
Files
Functions
Variables
Modules
Pages
PageReadingTimeTest.php
Go to the documentation of this file.
1
<?php
2
19
declare(strict_types=1);
20
21
namespace
ILIAS\ContentPage
;
22
23
use
ILIAS\ContentPage\PageMetrics\ValueObject\PageReadingTime
;
24
use
PHPUnit\Framework\TestCase
;
25
use
TypeError
;
26
use
stdClass
;
27
32
class
PageReadingTimeTest
extends
TestCase
33
{
34
public
function
mixedReadingTypesProvider
(): array
35
{
36
return
[
37
'Float Type'
=> [4.0],
38
'String Type'
=> [
'4'
],
39
'Array Type'
=> [[4]],
40
'Object Type'
=> [
new
stdClass
()],
41
'Boolean Type'
=> [
false
],
42
'Null Type'
=> [null],
43
'Ressource Type'
=> [fopen(
'php://temp'
,
'rb'
)]
44
];
45
}
46
51
public
function
testPageReadingTimeValueThrowsExceptionWhenConstructedWithInvalidTypes
($mixedType): void
52
{
53
$this->expectException(TypeError::class);
54
55
$readingTime =
new
PageReadingTime
($mixedType);
56
}
57
58
public
function
testRawReadingTimeCanBeRetrievedFromValueObject
(): void
59
{
60
$readingTime =
new
PageReadingTime
(5);
61
$this->assertSame(5, $readingTime->minutes());
62
}
63
}
ILIAS\ContentPage\PageReadingTimeTest
Class PageReadingTimeTest.
Definition:
PageReadingTimeTest.php:32
stdClass
ILIAS\ContentPage\PageMetrics\ValueObject\PageReadingTime
Definition:
PageReadingTime.php:30
ILIAS\ContentPage
ILIAS\ContentPage\PageReadingTimeTest\testPageReadingTimeValueThrowsExceptionWhenConstructedWithInvalidTypes
testPageReadingTimeValueThrowsExceptionWhenConstructedWithInvalidTypes($mixedType)
Definition:
PageReadingTimeTest.php:51
TypeError
ILIAS\ContentPage\PageReadingTimeTest\testRawReadingTimeCanBeRetrievedFromValueObject
testRawReadingTimeCanBeRetrievedFromValueObject()
Definition:
PageReadingTimeTest.php:58
PageReadingTime
ILIAS\ContentPage\PageReadingTimeTest\mixedReadingTypesProvider
mixedReadingTypesProvider()
Definition:
PageReadingTimeTest.php:34
TestCase
Modules
ContentPage
test
PageReadingTimeTest.php
Generated on Tue Apr 1 2025 22:01:23 for ILIAS by
1.8.13 (using
Doxyfile
)