ILIAS  release_9 Revision v9.13-25-g2c18ec4c24f
ToastTest Class Reference
+ Inheritance diagram for ToastTest:
+ Collaboration diagram for ToastTest:

Public Member Functions

 getToastFactory ()
 
 getIconFactory ()
 
 getLinkFactory ()
 
 testImplementsFactoryInterface ()
 
 testToast (string $title, string $description, string $action)
 getToastProvider More...
 
 testToastContainer (string $title, string $description)
 getToastProvider More...
 
 getToastProvider ()
 
- Public Member Functions inherited from ILIAS_UI_TestBase
 setUp ()
 
 tearDown ()
 
 getUIFactory ()
 
 getTemplateFactory ()
 
 getResourceRegistry ()
 
 getLanguage ()
 
 getJavaScriptBinding ()
 
 getRefinery ()
 
 getImagePathResolver ()
 
 getDataFactory ()
 
 getHelpTextRetriever ()
 
 getUploadLimitResolver ()
 
 getDefaultRenderer (JavaScriptBinding $js_binding=null, array $with_stub_renderings=[])
 
 getDecoratedRenderer (Renderer $default)
 
 normalizeHTML (string $html)
 
 assertHTMLEquals (string $expected_html_as_string, string $html_as_string)
 

Additional Inherited Members

- Protected Member Functions inherited from ILIAS_UI_TestBase
 brutallyTrimHTML (string $html)
 A more radical version of normalizeHTML. More...
 
 brutallyTrimSignals (string $html)
 A naive replacement of all il_signal-ids with dots to ease comparisons of rendered output. More...
 

Detailed Description

Definition at line 28 of file ToastTest.php.

Member Function Documentation

◆ getIconFactory()

ToastTest::getIconFactory ( )

Definition at line 35 of file ToastTest.php.

Referenced by testToast(), and testToastContainer().

36  {
38  }
This is how the factory for UI elements looks.
Definition: Factory.php:37
+ Here is the caller graph for this function:

◆ getLinkFactory()

ToastTest::getLinkFactory ( )

Definition at line 40 of file ToastTest.php.

Referenced by testToast().

+ Here is the caller graph for this function:

◆ getToastFactory()

ToastTest::getToastFactory ( )

Definition at line 30 of file ToastTest.php.

Referenced by testImplementsFactoryInterface(), testToast(), and testToastContainer().

31  {
33  }
Class ChatMainBarProvider .
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...
+ Here is the caller graph for this function:

◆ getToastProvider()

ToastTest::getToastProvider ( )

Definition at line 90 of file ToastTest.php.

90  : array
91  {
92  return [
93  ['title', 'description', 'test.php'],
94  ['', '', ''],
95  ['"/><script>alert("hack")</script>', '"/><script>alert("hack")</script>', 'test.php']
96  ];
97  }

◆ testImplementsFactoryInterface()

ToastTest::testImplementsFactoryInterface ( )

Definition at line 45 of file ToastTest.php.

References Vendor\Package\$f, and getToastFactory().

45  : void
46  {
47  $f = $this->getToastFactory();
48 
49  $this->assertInstanceOf("ILIAS\\UI\\Component\\Toast\\Factory", $f);
50 
51  $this->assertInstanceOf("ILIAS\\UI\\Component\\Toast\\Toast", $f->standard('', $this->getIconFactory()->standard('', '')));
52  $this->assertInstanceOf("ILIAS\\UI\\Component\\Toast\\Container", $f->container());
53  }
getToastFactory()
Definition: ToastTest.php:30
+ Here is the call graph for this function:

◆ testToast()

ToastTest::testToast ( string  $title,
string  $description,
string  $action 
)

getToastProvider

Definition at line 58 of file ToastTest.php.

References getIconFactory(), getLinkFactory(), getToastFactory(), and ILIAS\UI\examples\MainControls\Slate\Notification\standard().

58  : void
59  {
60  $toast = $this->getToastFactory()->standard($title, $this->getIconFactory()->standard('', ''))
61  ->withDescription($description)
62  ->withAction($action)
63  ->withAdditionalLink($this->getLinkFactory()->standard('', ''));
64 
65  $this->assertNotNull($toast);
66  $this->assertEquals($title, $toast->getTitle());
67  $this->assertEquals($description, $toast->getDescription());
68  $this->assertEquals($action, $toast->getAction());
69  $this->assertCount(1, $toast->getLinks());
70  $this->assertInstanceOf(Link::class, $toast->getLinks()[0]);
71  $this->assertCount(0, $toast->withoutLinks()->getLinks());
72  $this->assertInstanceOf(Icon::class, $toast->getIcon());
73  }
standard()
This is an example, of how the Notification Slate is generated by assigning Notification Items to it...
Definition: standard.php:16
getLinkFactory()
Definition: ToastTest.php:40
getIconFactory()
Definition: ToastTest.php:35
getToastFactory()
Definition: ToastTest.php:30
+ Here is the call graph for this function:

◆ testToastContainer()

ToastTest::testToastContainer ( string  $title,
string  $description 
)

getToastProvider

Definition at line 78 of file ToastTest.php.

References $container, getIconFactory(), getToastFactory(), and ILIAS\UI\examples\MainControls\Slate\Notification\standard().

78  : void
79  {
80  $container = $this->getToastFactory()->container()->withAdditionalToast(
81  $this->getToastFactory()->standard('', $this->getIconFactory()->standard('', ''))
82  );
83 
84  $this->assertNotNull($container);
85  $this->assertCount(1, $container->getToasts());
86  $this->assertInstanceOf(Toast::class, $container->getToasts()[0]);
87  $this->assertCount(0, $container->withoutToasts()->getToasts());
88  }
standard()
This is an example, of how the Notification Slate is generated by assigning Notification Items to it...
Definition: standard.php:16
$container
Definition: wac.php:14
getIconFactory()
Definition: ToastTest.php:35
getToastFactory()
Definition: ToastTest.php:30
+ Here is the call graph for this function:

The documentation for this class was generated from the following file: