ILIAS  release_6 Revision v6.24-5-g0c8bfefb3b8
ILIAS\Tests\Setup\ArrayArtifactTest Class Reference
+ Inheritance diagram for ILIAS\Tests\Setup\ArrayArtifactTest:
+ Collaboration diagram for ILIAS\Tests\Setup\ArrayArtifactTest:

Public Member Functions

 testSerialize ()
 
 testOnlyPrimitives ()
 

Detailed Description

Definition at line 9 of file ArrayArtifactTest.php.

Member Function Documentation

◆ testOnlyPrimitives()

ILIAS\Tests\Setup\ArrayArtifactTest::testOnlyPrimitives ( )

Definition at line 28 of file ArrayArtifactTest.php.

29 {
30 $this->expectException(\InvalidArgumentException::class);
31
32 $data = [ $this ];
33
34 $a = new Setup\ArrayArtifact($data);
35 }
$a
thx to https://mlocati.github.io/php-cs-fixer-configurator for the examples
$data
Definition: storeScorm.php:23

References Vendor\Package\$a, and $data.

◆ testSerialize()

ILIAS\Tests\Setup\ArrayArtifactTest::testSerialize ( )

Definition at line 11 of file ArrayArtifactTest.php.

12 {
13 $data = [
14 "one" => 1,
15 "two" => 2,
16 "nested" => [
17 "array" => "are nice"
18 ]
19 ];
20
21 $a = new Setup\ArrayArtifact($data);
22
23 $serialized = $a->serialize();
24
25 $this->assertEquals($data, eval("?>" . $serialized));
26 }

References Vendor\Package\$a, and $data.


The documentation for this class was generated from the following file: