ILIAS  trunk Revision v11.0_alpha-2662-g519ff7d528f
BaseToastSetUp Class Reference
+ Inheritance diagram for BaseToastSetUp:
+ Collaboration diagram for BaseToastSetUp:

Public Member Functions

 getDIC ()
 
 getDummyToastProviderWithToasts (array $toasts)
 

Protected Member Functions

 setUp ()
 

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.

References ILIAS\Repository\globalScreen().

Referenced by getDummyToastProviderWithToasts().

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:35
+ 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.

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

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

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: result.php:31
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ setUp()

BaseToastSetUp::setUp ( )
protected

Definition at line 44 of file BaseToastSetUp.php.

References factory().

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()
+ 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: