ILIAS  trunk Revision v11.0_alpha-1715-g7fc467680fb
All Data Structures Namespaces Files Functions Variables Enumerations Enumerator Modules Pages
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...
 

Static Public Member Functions

static getToastProvider ()
 

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().

35  : \ILIAS\UI\Implementation\Component\Symbol\Icon\Factory
36  {
38  }
+ Here is the caller graph for this function:

◆ getLinkFactory()

ToastTest::getLinkFactory ( )

Definition at line 40 of file ToastTest.php.

Referenced by testToast().

40  : \ILIAS\UI\Implementation\Component\Link\Factory
41  {
43  }
+ 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().

30  : \ILIAS\UI\Implementation\Component\Toast\Factory
31  {
33  }
Interface Observer Contains several chained tasks and infos about them.
+ Here is the caller graph for this function:

◆ getToastProvider()

static ToastTest::getToastProvider ( )
static

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()
description: > This is an example, of how the Notification Slate is generated by assigning Notificat...
Definition: standard.php:38
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()
description: > This is an example, of how the Notification Slate is generated by assigning Notificat...
Definition: standard.php:38
$container
Definition: wac.php:36
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: