ILIAS  trunk Revision v11.0_alpha-3011-gc6b235a2e85
ArrayArtifactTest.php
Go to the documentation of this file.
1<?php
2
19declare(strict_types=1);
20
22
24use PHPUnit\Framework\TestCase;
25
26class ArrayArtifactTest extends TestCase
27{
28 public function testSerialize(): void
29 {
30 $data = [
31 "one" => 1,
32 "two" => 2,
33 "nested" => [
34 "array" => "are nice"
35 ]
36 ];
37
39
40 $serialized = $a->serialize();
41
42 $this->assertEquals($data, eval("?>" . $serialized));
43 }
44
45 public function testOnlyPrimitives(): void
46 {
47 $this->expectException(\InvalidArgumentException::class);
48
49 $data = [ $this ];
50
52 }
53}
An array as an artifact.
$a
thx to https://mlocati.github.io/php-cs-fixer-configurator for the examples