ILIAS  trunk Revision v11.0_alpha-3011-gc6b235a2e85
ILIAS\GlobalScreen\MainMenu\FactoryImplTest Class Reference

Class FactoryImplTest. More...

+ Inheritance diagram for ILIAS\GlobalScreen\MainMenu\FactoryImplTest:
+ Collaboration diagram for ILIAS\GlobalScreen\MainMenu\FactoryImplTest:

Public Member Functions

 testAvailableMethods ()
 
 testInterchangeableContraints ()
 

Protected Member Functions

 setUp ()
 @inheritDoc More...
 

Protected Attributes

IdentificationInterface $id
 
StaticMainMenuProvider $provider
 
IdentificationFactory $identification
 
MainMenuItemFactory $factory
 

Detailed Description

Class FactoryImplTest.

Author
Fabian Schmid fs@st.nosp@m.uder.nosp@m.-raim.nosp@m.ann..nosp@m.ch

Definition at line 38 of file FactoryImplTest.php.

Member Function Documentation

◆ setUp()

ILIAS\GlobalScreen\MainMenu\FactoryImplTest::setUp ( )
protected

@inheritDoc

Definition at line 49 of file FactoryImplTest.php.

49 : void
50 {
51 parent::setUp();
52
53 $this->identification = new IdentificationFactory(new NullProviderFactory());
54 $this->provider = $this->getMockBuilder(StaticMainMenuProvider::class)->getMock();
55
56 $this->id = $this->identification->core($this->provider)->identifier('dummy');
57
58 $this->factory = new MainMenuItemFactory();
59 }
factory()

References factory().

+ Here is the call graph for this function:

◆ testAvailableMethods()

ILIAS\GlobalScreen\MainMenu\FactoryImplTest::testAvailableMethods ( )

Definition at line 62 of file FactoryImplTest.php.

62 : void
63 {
64 $r = new ReflectionClass($this->factory);
65
66 $methods = [];
67 foreach ($r->getMethods(ReflectionMethod::IS_PUBLIC) as $method) {
68 $methods[] = $method->getName();
69 }
70 sort($methods);
71 $this->assertSame(
72 [
73 0 => 'complex',
74 1 => 'custom',
75 2 => 'link',
76 3 => 'linkList',
77 4 => 'repositoryLink',
78 5 => 'separator',
79 6 => 'topLinkItem',
80 7 => 'topParentItem',
81 ],
82 $methods
83 );
84 }

References factory(), and ILIAS\UI\examples\Symbol\Glyph\Sort\sort().

+ Here is the call graph for this function:

◆ testInterchangeableContraints()

ILIAS\GlobalScreen\MainMenu\FactoryImplTest::testInterchangeableContraints ( )

Definition at line 87 of file FactoryImplTest.php.

87 : void
88 {
89 $this->assertInstanceOf(isInterchangeableItem::class, $this->factory->topLinkItem($this->id));
90 $this->assertNotInstanceOf(isInterchangeableItem::class, $this->factory->topParentItem($this->id));
91 $this->assertInstanceOf(isInterchangeableItem::class, $this->factory->complex($this->id));
92 $this->assertInstanceOf(isInterchangeableItem::class, $this->factory->link($this->id));
93 $this->assertInstanceOf(isInterchangeableItem::class, $this->factory->repositoryLink($this->id));
94 $this->assertNotInstanceOf(isInterchangeableItem::class, $this->factory->separator($this->id));
95 }

References factory().

+ Here is the call graph for this function:

Field Documentation

◆ $factory

MainMenuItemFactory ILIAS\GlobalScreen\MainMenu\FactoryImplTest::$factory
protected

Definition at line 43 of file FactoryImplTest.php.

◆ $id

IdentificationInterface ILIAS\GlobalScreen\MainMenu\FactoryImplTest::$id
protected

Definition at line 40 of file FactoryImplTest.php.

◆ $identification

IdentificationFactory ILIAS\GlobalScreen\MainMenu\FactoryImplTest::$identification
protected

Definition at line 42 of file FactoryImplTest.php.

◆ $provider

StaticMainMenuProvider ILIAS\GlobalScreen\MainMenu\FactoryImplTest::$provider
protected

Definition at line 41 of file FactoryImplTest.php.


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