ILIAS  trunk Revision v11.0_alpha-1715-g7fc467680fb
All Data Structures Namespaces Files Functions Variables Enumerations Enumerator Modules Pages
ToastCollectorTest.php
Go to the documentation of this file.
1 <?php
2 
19 declare(strict_types=1);
20 
23 
24 require_once(__DIR__ . "/../BaseToastSetUp.php");
25 
27 {
28  public function testConstruct(): void
29  {
31  $collector = new ToastCollector([$provider]);
32  $this->assertInstanceOf(ToastCollector::class, $collector);
33  }
34 
35  public function testGetToasts(): void
36  {
38  $collector = new ToastCollector([$provider]);
39  $this->assertEquals([], $collector->getToasts());
40 
41  $id_one = $this->createMock(IdentificationInterface::class);
42  $id_two = $this->createMock(IdentificationInterface::class);
43 
44  $toast1 = $this->factory->standard(
45  $id_one,
46  'Test Toast 1'
47  );
48 
49  $toast2 = $this->factory->standard(
50  $id_two,
51  'Test Toast 2'
52  );
53 
54  $provider = $this->getDummyToastProviderWithToasts([$toast1, $toast2]);
55  $collector = new ToastCollector([$provider]);
56  $this->assertEquals([$toast1, $toast2], $collector->getToasts());
57  }
58 }
factory()
ToastProvider $provider
getDummyToastProviderWithToasts(array $toasts)