ILIAS  release_5-4 Revision v5.4.26-12-gabc799a52e6
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 ()
 
 testTopItemConstraints ()
 
 testChildConstraints ()
 

Protected Member Functions

 setUp ()
 @inheritDoc More...
 

Protected Attributes

 $id
 
 $provider
 
 $identification
 
 $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 24 of file FactoryImplTest.php.

Member Function Documentation

◆ setUp()

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

@inheritDoc

Definition at line 48 of file FactoryImplTest.php.

49 {
50 parent::setUp();
51
52 $this->identification = new IdentificationFactory(new NullProviderFactory());
53 $this->provider = \Mockery::mock(StaticMainMenuProvider::class);
54 $this->provider->shouldReceive('getProviderNameForPresentation')->andReturn('Provider');
55
56 $this->id = $this->identification->core($this->provider)->identifier('dummy');
57
58 $this->factory = new MainMenuItemFactory();
59 }

◆ testAvailableMethods()

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

Definition at line 62 of file FactoryImplTest.php.

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->assertEquals(
72 $methods,
73 [
74 0 => 'complex',
75 1 => 'custom',
76 2 => 'link',
77 3 => 'linkList',
78 4 => 'repositoryLink',
79 5 => 'separator',
80 6 => 'topLinkItem',
81 7 => 'topParentItem',
82 ]
83 );
84 }
$r
Definition: example_031.php:79

References $r.

◆ testChildConstraints()

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

Definition at line 98 of file FactoryImplTest.php.

99 {
100 $this->assertNotInstanceOf(isChild::class, $this->factory->topLinkItem($this->id));
101 $this->assertNotInstanceOf(isChild::class, $this->factory->topParentItem($this->id));
102 $this->assertInstanceOf(isChild::class, $this->factory->complex($this->id));
103 $this->assertInstanceOf(isChild::class, $this->factory->link($this->id));
104 $this->assertInstanceOf(isChild::class, $this->factory->repositoryLink($this->id));
105 $this->assertInstanceOf(isChild::class, $this->factory->separator($this->id));
106 }

◆ testTopItemConstraints()

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

Definition at line 87 of file FactoryImplTest.php.

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

Field Documentation

◆ $factory

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

Definition at line 42 of file FactoryImplTest.php.

◆ $id

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

Definition at line 30 of file FactoryImplTest.php.

◆ $identification

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

Definition at line 38 of file FactoryImplTest.php.

◆ $provider

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

Definition at line 34 of file FactoryImplTest.php.


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