ILIAS  release_8 Revision v8.24
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 22 of file FactoryImplTest.php.

Member Function Documentation

◆ setUp()

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

@inheritDoc

Definition at line 33 of file FactoryImplTest.php.

33 : void
34 {
35 parent::setUp();
36
37 $this->identification = new IdentificationFactory(new NullProviderFactory());
38 $this->provider = $this->getMockBuilder(StaticMainMenuProvider::class)->getMock();
39
40 $this->id = $this->identification->core($this->provider)->identifier('dummy');
41
42 $this->factory = new MainMenuItemFactory();
43 }

◆ testAvailableMethods()

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

Definition at line 46 of file FactoryImplTest.php.

46 : void
47 {
48 $r = new ReflectionClass($this->factory);
49
50 $methods = [];
51 foreach ($r->getMethods(ReflectionMethod::IS_PUBLIC) as $method) {
52 $methods[] = $method->getName();
53 }
54 sort($methods);
55 $this->assertEquals(
56 [
57 0 => 'complex',
58 1 => 'custom',
59 2 => 'link',
60 3 => 'linkList',
61 4 => 'repositoryLink',
62 5 => 'separator',
63 6 => 'topLinkItem',
64 7 => 'topParentItem',
65 ],
66 $methods
67 );
68 }

◆ testInterchangeableContraints()

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

Definition at line 71 of file FactoryImplTest.php.

71 : void
72 {
73 $this->assertInstanceOf(isInterchangeableItem::class, $this->factory->topLinkItem($this->id));
74 $this->assertNotInstanceOf(isInterchangeableItem::class, $this->factory->topParentItem($this->id));
75 $this->assertInstanceOf(isInterchangeableItem::class, $this->factory->complex($this->id));
76 $this->assertInstanceOf(isInterchangeableItem::class, $this->factory->link($this->id));
77 $this->assertInstanceOf(isInterchangeableItem::class, $this->factory->repositoryLink($this->id));
78 $this->assertNotInstanceOf(isInterchangeableItem::class, $this->factory->separator($this->id));
79 }

Field Documentation

◆ $factory

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

Definition at line 27 of file FactoryImplTest.php.

◆ $id

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

Definition at line 24 of file FactoryImplTest.php.

◆ $identification

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

Definition at line 26 of file FactoryImplTest.php.

◆ $provider

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

Definition at line 25 of file FactoryImplTest.php.


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