ILIAS  release_8 Revision v8.24
ToastCollectorTest.php
Go to the documentation of this file.
1<?php
2
19declare(strict_types=1);
20
24
25require_once(__DIR__ . "/../BaseToastSetUp.php");
26
28{
29 public function testConstruct(): void
30 {
32 $collector = new ToastCollector([$provider]);
33 $this->assertInstanceOf(ToastCollector::class, $collector);
34 }
35
36 public function testGetToasts(): void
37 {
39 $collector = new ToastCollector([$provider]);
40 $this->assertEquals([], $collector->getToasts());
41
42 $id_one = $this->createMock(IdentificationInterface::class);
43 $id_two = $this->createMock(IdentificationInterface::class);
44
45 $toast1 = $this->factory->standard(
46 $id_one,
47 'Test Toast 1'
48 );
49
50 $toast2 = $this->factory->standard(
51 $id_two,
52 'Test Toast 2'
53 );
54
55 $provider = $this->getDummyToastProviderWithToasts([$toast1, $toast2]);
56 $collector = new ToastCollector([$provider]);
57 $this->assertEquals([$toast1, $toast2], $collector->getToasts());
58 }
59}
ToastProvider $provider
getDummyToastProviderWithToasts(array $toasts)
Class IdentificationFactory All elements in the GlobalScreen service must be identifiable for the sup...