19declare(strict_types=1);
32use PHPUnit\Framework\TestCase;
41 $md = $this->createMock(\
ILIAS\
Data\
Text\SimpleDocumentMarkdown::class);
47 $this->createMock(\
ILIAS\
Data\
Text\SimpleDocumentMarkdown::class),
53 $res = $desc->getPrimitiveRepresentation($object);
55 if (!is_null($expected)) {
56 $this->assertEquals($expected,
$res);
58 $this->assertInstanceOf(\Closure::class,
$res);
59 $errors = iterator_to_array(
$res());
60 $this->assertCount(1, $errors);
61 $this->assertTrue(is_string($errors[0]));
68 $o1_a =
new class () {
74 $o1_b =
new class () {
77 $e1 = new \StdClass();
81 $o2_a =
new class () {
82 public function getSomeValue():
int
87 $o2_b =
new class () {
88 public $some_value = 23;
90 $o2_c =
new class () {
91 public $someValue = 23;
93 $e2 = new \StdClass();
112 $this->expectException(\InvalidArgumentException::class);
115 $field =
new Field($name, $this->createMock(Description::class));
116 $this->assertEquals($name, $field->getName());
137 $this->createMock(\
ILIAS\
Data\
Text\SimpleDocumentMarkdown::class)
139 $res = $desc->getPrimitiveRepresentation(
$data);
141 $this->assertInstanceOf(\Closure::class,
$res);
142 $errors = iterator_to_array(
$res());
143 $this->assertCount(1, $errors);
144 $this->assertTrue(is_string($errors[0]));
150 [1], [
"1"], [
null], [
true], [[]]
static obviousNoMatchProvider()
testAllowedFieldNames(string $name, bool $is_allowed)
@dataProvider fieldNamesProvider
static fieldNamesProvider()
testObviouslyNotMatching($data)
@dataProvider obviousNoMatchProvider
static simpleObjectsProvider()
testSimpleObject(string $field, $object, $expected)
@dataProvider simpleObjectsProvider
This describes some datastructure in terms of standard data structures such as primitives,...
Interface Observer \BackgroundTasks Contains several chained tasks and infos about them.