ILIAS  release_6 Revision v6.24-5-g0c8bfefb3b8
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
5namespace ILIAS\Tests\Setup;
6
8
9class ArrayArtifactTest extends \PHPUnit\Framework\TestCase
10{
11 public function testSerialize()
12 {
13 $data = [
14 "one" => 1,
15 "two" => 2,
16 "nested" => [
17 "array" => "are nice"
18 ]
19 ];
20
22
23 $serialized = $a->serialize();
24
25 $this->assertEquals($data, eval("?>" . $serialized));
26 }
27
28 public function testOnlyPrimitives()
29 {
30 $this->expectException(\InvalidArgumentException::class);
31
32 $data = [ $this ];
33
35 }
36}
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