19 declare(strict_types=1);
33 $lng = $this->createMock(ilLanguage::class);
34 $tpl = $this->createMock(ilGlobalTemplateInterface::class);
36 $this->topic =
'a test topic';
38 $this->collection = $this->messages->getMessageCollection($this->topic);
39 $this->collection2 = $this->messages->getMessageCollection($this->topic);
44 $this->assertInstanceOf(ilPRGMessageCollection::class, $this->collection);
45 $this->assertEquals($this->collection, $this->collection2);
46 $this->assertNotSame($this->collection, $this->collection2);
51 $this->assertEquals($this->topic, $this->collection->getDescription());
53 $this->assertFalse($this->collection->hasErrors());
54 $this->assertEquals([], $this->collection->getErrors());
56 $this->assertFalse($this->collection->hasSuccess());
57 $this->assertEquals([], $this->collection->getSuccess());
59 $this->assertFalse($this->collection->hasAnyMessages());
64 $ok_message =
'looks good';
65 $ok_id =
'some good record';
66 $this->collection->add(
true, $ok_message, $ok_id);
68 $this->assertTrue($this->collection->hasAnyMessages());
70 $this->assertFalse($this->collection->hasErrors());
71 $this->assertEquals([], $this->collection->getErrors());
73 $this->assertTrue($this->collection->hasSuccess());
75 [[$ok_message, $ok_id]],
76 $this->collection->getSuccess()
85 $this->assertFalse($this->collection->hasAnyMessages());
86 $collection = $this->collection->
withNewTopic($this->topic);
87 $this->assertFalse($collection->hasAnyMessages());
92 $this->assertTrue($collection->hasAnyMessages());
94 $this->assertTrue($collection->hasErrors());
97 $collection->getErrors()
100 $this->assertEquals([], $collection->getSuccess());
101 $this->assertFalse($collection->hasSuccess());
Util around ilPRGMessageCollection factors and output collections.
withNewTopic(string $description)
ilPRGMessageCollection $collection2
ilPRGMessagePrinter $messages
$id
plugin.php for ilComponentBuildPluginInfoObjectiveTest::testAddPlugins
ilPRGMessageCollection $collection
Holds information about multi-actions, mainly in context of member-assignemnts and status changes...