19 declare(strict_types=1);
33 require_once __DIR__ .
'/../ContainerMock.php';
41 $this->assertInstanceOf(UserCountry::class,
new UserCountry(
42 $this->mock(CriterionContent::class),
43 $this->mock(UserCountryDefinition::class),
44 $this->mock(UIFactory::class)
50 $legacy = $this->mock(Legacy\Content::class);
51 $legacy_factory = $this->mock(Legacy\Factory::class);
53 ->expects($this->once())
55 ->willReturn($legacy);
58 $this->mockTree(CriterionContent::class, [
'arguments' => [
'country' =>
'foo']]),
59 $this->mock(UserCountryDefinition::class),
60 $this->mockTree(UIFactory::class, [
'legacy' => $legacy_factory])
63 $this->assertSame($legacy, $instance->asComponent());
69 $this->mockTree(CriterionContent::class, [
'arguments' => [
'country' =>
'foo']]),
70 $this->mock(UserCountryDefinition::class),
71 $this->mock(UIFactory::class)
74 $this->assertTrue($instance->eval($this->mockTree(ilObjUser::class, [
'getCountry' =>
'foo'])));
79 $definition = $this->mock(UserCountryDefinition::class);
81 $this->mock(CriterionContent::class),
83 $this->mock(UIFactory::class)
86 $this->assertSame($definition, $instance->definition());
92 $this->mock(CriterionContent::class),
93 $this->mock(UserCountryDefinition::class),
94 $this->mock(UIFactory::class)
98 $this->mock(CriterionContent::class),
99 $this->mock(UserCountryDefinition::class),
100 $this->mock(UIFactory::class)
103 $this->assertTrue($instance->knownToNeverMatchWith($second));
104 $this->assertFalse($instance->knownToNeverMatchWith($this->mock(Condition::class)));
testKnownToNeverMatchWith()