19declare(strict_types=1);
21use PHPUnit\Framework\TestCase;
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());
$id
plugin.php for ilComponentBuildPluginInfoObjectiveTest::testAddPlugins
Holds information about multi-actions, mainly in context of member-assignemnts and status changes.
add(bool $success, string $message, string $record_identitifer)
withNewTopic(string $description)
Util around ilPRGMessageCollection factors and output collections.
ilPRGMessagePrinter $messages
ilPRGMessageCollection $collection2
ilPRGMessageCollection $collection