ILIAS  trunk Revision v11.0_alpha-3011-gc6b235a2e85
ClassificationSessionRepositoryTest.php
Go to the documentation of this file.
1<?php
2
19declare(strict_types=1);
20
21use PHPUnit\Framework\TestCase;
22
24{
25 protected \ILIAS\Container\Classification\ClassificationSessionRepository $repo;
26
27 protected function setUp(): void
28 {
29 parent::setUp();
30 $this->repo = new \ILIAS\Container\Classification\ClassificationSessionRepository(14);
31 }
32
33 protected function tearDown(): void
34 {
35 }
36
37 public function testValueForProvider(): void
38 {
40 $repo->setValueForProvider("prov", [1, 2, 3]);
41 $this->assertEquals(
42 [1, 2, 3],
43 $repo->getValueForProvider("prov")
44 );
45 }
46
47 public function testUnsetAll(): void
48 {
50 $repo->setValueForProvider("prov", [1, 2, 3]);
51 $repo->unsetAll();
52 $this->assertEquals(
53 [],
54 $repo->getValueForProvider("prov")
55 );
56 }
57
58 public function testUnsetValueForProvider(): void
59 {
61 $repo->setValueForProvider("prov1", [1, 2, 3]);
62 $repo->setValueForProvider("prov2", [3, 4, 5]);
63 $repo->unsetValueForProvider("prov1");
64 $this->assertEquals(
65 [],
66 $repo->getValueForProvider("prov1")
67 );
68 $this->assertEquals(
69 [3, 4, 5],
70 $repo->getValueForProvider("prov2")
71 );
72 }
73}
ILIAS Container Classification ClassificationSessionRepository $repo