ILIAS  trunk Revision v11.0_alpha-1702-gfd3ecb7f852
All Data Structures Namespaces Files Functions Variables Enumerations Enumerator Modules Pages
ilCollectionTest.php
Go to the documentation of this file.
1 <?php
2 
19 declare(strict_types=1);
20 
22 
23 use ILIAS\Export\ImportHandler\Validation\Set\Collection as ilFileValidationSetCollection;
24 use ILIAS\Export\ImportHandler\Validation\Set\Handler as ilFileValidationSetHandler;
26 
27 class ilCollectionTest extends TestCase
28 {
29  public function testSetCollection(): void
30  {
31  $set1 = $this->createMock(ilFileValidationSetHandler::class);
32  $set2 = $this->createMock(ilFileValidationSetHandler::class);
33  $set3 = $this->createMock(ilFileValidationSetHandler::class);
34  $sets = [$set1, $set2, $set3];
35 
36  $collection = (new ilFileValidationSetCollection())
37  ->withElement($set1)
38  ->withElement($set2)
39  ->withElement($set3);
40 
41  $this->assertCount(3, $collection);
42  for ($i = 0; $i < 3; $i++) {
43  $sets[$i] = $collection->toArray()[$i];
44  }
45  }
46 }