ILIAS  trunk Revision v11.0_alpha-3011-gc6b235a2e85
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 = []
 

Detailed Description

Definition at line 35 of file BaseToastSetUp.php.

Member Function Documentation

◆ getDIC()

BaseToastSetUp::getDIC ( )

Definition at line 54 of file BaseToastSetUp.php.

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

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 69 of file BaseToastSetUp.php.

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

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 44 of file BaseToastSetUp.php.

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

References factory().

+ Here is the call graph for this function:

Field Documentation

◆ $factory

ToastFactory BaseToastSetUp::$factory
protected

Definition at line 39 of file BaseToastSetUp.php.

◆ $provider

◆ $toasts

array BaseToastSetUp::$toasts = []
private

Definition at line 37 of file BaseToastSetUp.php.

Referenced by getDummyToastProviderWithToasts().


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