ILIAS  trunk Revision v11.0_alpha-3011-gc6b235a2e85
ILIAS\LegalDocuments\test\Condition\UserCountryTest Class Reference
+ Inheritance diagram for ILIAS\LegalDocuments\test\Condition\UserCountryTest:
+ Collaboration diagram for ILIAS\LegalDocuments\test\Condition\UserCountryTest:

Public Member Functions

 testConstruct ()
 
 testAsComponent ()
 
 testEval ()
 
 testDefinition ()
 
 testKnownToNeverMatchWith ()
 

Detailed Description

Definition at line 35 of file UserCountryTest.php.

Member Function Documentation

◆ testAsComponent()

ILIAS\LegalDocuments\test\Condition\UserCountryTest::testAsComponent ( )

Definition at line 48 of file UserCountryTest.php.

48 : void
49 {
50 $legacy = $this->mock(Legacy\Content::class);
51 $legacy_factory = $this->mock(Legacy\Factory::class);
52 $legacy_factory
53 ->expects($this->once())
54 ->method('content')
55 ->willReturn($legacy);
56
57 $instance = new UserCountry(
58 $this->mockTree(CriterionContent::class, ['arguments' => ['country' => 'foo']]),
59 $this->mock(UserCountryDefinition::class),
60 $this->mockTree(UIFactory::class, ['legacy' => $legacy_factory])
61 );
62
63 $this->assertSame($legacy, $instance->asComponent());
64 }

◆ testConstruct()

ILIAS\LegalDocuments\test\Condition\UserCountryTest::testConstruct ( )

Definition at line 39 of file UserCountryTest.php.

39 : void
40 {
41 $this->assertInstanceOf(UserCountry::class, new UserCountry(
42 $this->mock(CriterionContent::class),
43 $this->mock(UserCountryDefinition::class),
44 $this->mock(UIFactory::class)
45 ));
46 }

◆ testDefinition()

ILIAS\LegalDocuments\test\Condition\UserCountryTest::testDefinition ( )

Definition at line 77 of file UserCountryTest.php.

77 : void
78 {
79 $definition = $this->mock(UserCountryDefinition::class);
80 $instance = new UserCountry(
81 $this->mock(CriterionContent::class),
82 $definition,
83 $this->mock(UIFactory::class)
84 );
85
86 $this->assertSame($definition, $instance->definition());
87 }

◆ testEval()

ILIAS\LegalDocuments\test\Condition\UserCountryTest::testEval ( )

Definition at line 66 of file UserCountryTest.php.

66 : void
67 {
68 $instance = new UserCountry(
69 $this->mockTree(CriterionContent::class, ['arguments' => ['country' => 'foo']]),
70 $this->mock(UserCountryDefinition::class),
71 $this->mock(UIFactory::class)
72 );
73
74 $this->assertTrue($instance->eval($this->mockTree(ilObjUser::class, ['getCountry' => 'foo'])));
75 }

◆ testKnownToNeverMatchWith()

ILIAS\LegalDocuments\test\Condition\UserCountryTest::testKnownToNeverMatchWith ( )

Definition at line 89 of file UserCountryTest.php.

89 : void
90 {
91 $instance = new UserCountry(
92 $this->mock(CriterionContent::class),
93 $this->mock(UserCountryDefinition::class),
94 $this->mock(UIFactory::class)
95 );
96
97 $second = new UserCountry(
98 $this->mock(CriterionContent::class),
99 $this->mock(UserCountryDefinition::class),
100 $this->mock(UIFactory::class)
101 );
102
103 $this->assertTrue($instance->knownToNeverMatchWith($second));
104 $this->assertFalse($instance->knownToNeverMatchWith($this->mock(Condition::class)));
105 }

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