ILIAS
release_7 Revision v7.30-3-g800a261c036
◀ ilDoc Overview
ArrayArtifactTest.php
Go to the documentation of this file.
1
<?php
2
3
/* Copyright (c) 2019 Richard Klees <richard.klees@concepts-and-training.de> Extended GPL, see docs/LICENSE */
4
5
namespace
ILIAS\Tests\Setup\Artifact
;
6
7
use
ILIAS\Setup\Artifact
;
8
use
PHPUnit\Framework\TestCase
;
9
10
class
ArrayArtifactTest
extends
TestCase
11
{
12
public
function
testSerialize
() : void
13
{
14
$data
= [
15
"one"
=> 1,
16
"two"
=> 2,
17
"nested"
=> [
18
"array"
=>
"are nice"
19
]
20
];
21
22
$a
=
new
Artifact\ArrayArtifact(
$data
);
23
24
$serialized =
$a
->serialize();
25
26
$this->assertEquals(
$data
, eval(
"?>"
. $serialized));
27
}
28
29
public
function
testOnlyPrimitives
() : void
30
{
31
$this->expectException(\InvalidArgumentException::class);
32
33
$data
= [ $this ];
34
35
new
Artifact\ArrayArtifact(
$data
);
36
}
37
}
$data
$data
Definition:
storeScorm.php:23
ILIAS\Setup\Artifact
Definition:
ArrayArtifact.php:5
ILIAS\Tests\Setup\Artifact\ArrayArtifactTest\testSerialize
testSerialize()
Definition:
ArrayArtifactTest.php:12
ILIAS\Tests\Setup\Artifact\ArrayArtifactTest\testOnlyPrimitives
testOnlyPrimitives()
Definition:
ArrayArtifactTest.php:29
ILIAS\Tests\Setup\Artifact
Definition:
ArrayArtifactTest.php:5
Vendor\Package\$a
$a
thx to https://mlocati.github.io/php-cs-fixer-configurator for the examples
Definition:
example_cleaned.php:31
ILIAS\Tests\Setup\Artifact\ArrayArtifactTest
Definition:
ArrayArtifactTest.php:10
TestCase
tests
Setup
Artifact
ArrayArtifactTest.php
Generated on Wed Sep 3 2025 21:01:48 for ILIAS by
1.8.13 (using
Doxyfile
)