ILIAS  release_7 Revision v7.30-3-g800a261c036
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
6
8use PHPUnit\Framework\TestCase;
9
10class 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
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
36 }
37}
An exception for terminatinating execution or to throw for unit testing.
An array as an artifact.
$a
thx to https://mlocati.github.io/php-cs-fixer-configurator for the examples
$data
Definition: storeScorm.php:23