ILIAS  release_8 Revision v8.24
BaseToastSetUp Class Reference
+ Inheritance diagram for BaseToastSetUp:
+ Collaboration diagram for BaseToastSetUp:

Public Member Functions

 getDIC ()
 
 getDummyToastProviderWithToasts (array $toasts)
 

Protected Member Functions

 setUp ()
 @inheritDoc More...
 

Protected Attributes

ToastProvider $provider
 
ToastFactory $factory
 

Private Attributes

array $toasts = []
 
ILIAS DI UIServices $ui_mock
 

Detailed Description

Definition at line 32 of file BaseToastSetUp.php.

Member Function Documentation

◆ getDIC()

BaseToastSetUp::getDIC ( )

Definition at line 53 of file BaseToastSetUp.php.

54 {
55 $mocks = [
56 'ui' => $this->createMock(\ILIAS\DI\UIServices::class),
57 'ui.factory' => $this->createMock(\ILIAS\UI\Factory::class),
58 'provider_factory'=> $this->createMock(ProviderFactory::class),
59 ];
60 return new class ($mocks) extends ILIAS\DI\Container {
61 public function globalScreen(): Services
62 {
63 return new Services($this['provider_factory'], $this['ui']);
64 }
65 };
66 }
Customizing of pimple-DIC for ILIAS.
Definition: Container.php:32
Class HTTPServicesTest.
Class ChatMainBarProvider \MainMenu\Provider.
Class Factory.

References ILIAS\Repository\globalScreen().

Referenced by getDummyToastProviderWithToasts().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ getDummyToastProviderWithToasts()

BaseToastSetUp::getDummyToastProviderWithToasts ( array  $toasts)

Definition at line 68 of file BaseToastSetUp.php.

69 {
70 $dic = $this->getDIC();
71 $provider = new class ($dic) extends AbstractToastProvider {
72 public array $toasts;
73 public function getToasts(): array
74 {
75 return $this->toasts;
76 }
77 };
78 $provider->toasts = $toasts;
79 return $provider;
80 }
ToastProvider $provider
$dic
Definition: result.php:32

References $dic, $provider, $toasts, and getDIC().

Referenced by ToastCollectorTest\testConstruct(), DummyToastProviderTest\testConstruct(), and ToastCollectorTest\testGetToasts().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ setUp()

BaseToastSetUp::setUp ( )
protected

@inheritDoc

Definition at line 43 of file BaseToastSetUp.php.

43 : void
44 {
45 parent::setUp();
46
47 $this->ui_mock = $this->createMock(\ILIAS\DI\UIServices::class);
48 $this->provider = $this->createMock(ToastProvider::class);
49 $this->provider->expects($this->any())->method('getProviderNameForPresentation')->willReturn('Provider');
50 $this->factory = (new ToastServices($this->ui_mock))->factory();
51 }

Field Documentation

◆ $factory

ToastFactory BaseToastSetUp::$factory
protected

Definition at line 38 of file BaseToastSetUp.php.

◆ $provider

◆ $toasts

array BaseToastSetUp::$toasts = []
private

Definition at line 34 of file BaseToastSetUp.php.

Referenced by getDummyToastProviderWithToasts().

◆ $ui_mock

ILIAS DI UIServices BaseToastSetUp::$ui_mock
private

Definition at line 36 of file BaseToastSetUp.php.


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