ILIAS  trunk Revision v11.0_alpha-3011-gc6b235a2e85
EntityListingTest Class Reference
+ Inheritance diagram for EntityListingTest:
+ Collaboration diagram for EntityListingTest:

Public Member Functions

 getEntityMapping ()
 
 getUIFactory ()
 
 testEntityListingFactory ()
 
 testEntityListingYieldingEntities ()
 

Detailed Description

Definition at line 27 of file EntityListingTest.php.

Member Function Documentation

◆ getEntityMapping()

EntityListingTest::getEntityMapping ( )

Definition at line 29 of file EntityListingTest.php.

29 : I\Listing\Entity\RecordToEntity
30 {
31 return new class () implements I\Listing\Entity\RecordToEntity {
32 public function map(
33 UIFactory $ui_factory,
34 mixed $record
35 ): Entity\Entity {
36 return $ui_factory->entity()->standard('primary', 'secondary');
37 }
38 };
39 }
return['delivery_method'=> 'php',]
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...

Referenced by testEntityListingFactory(), and testEntityListingYieldingEntities().

+ Here is the caller graph for this function:

◆ getUIFactory()

EntityListingTest::getUIFactory ( )

Definition at line 40 of file EntityListingTest.php.

41 {
42 return new class () extends NoUIFactory {
43 public function listing(): Listing\Factory
44 {
45 return new Listing\Factory(
46 new Listing\Workflow\Factory(),
47 new Listing\CharacteristicValue\Factory(),
49 );
50 }
51 public function entity(): Entity\Factory
52 {
53 return new Entity\Factory();
54 }
55 };
56 }
This is the factory for Entities.
Definition: Factory.php:32

References ILIAS\Repository\listing().

Referenced by testEntityListingFactory(), and testEntityListingYieldingEntities().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ testEntityListingFactory()

EntityListingTest::testEntityListingFactory ( )

Definition at line 58 of file EntityListingTest.php.

58 : void
59 {
60 $this->assertInstanceOf(
61 I\Listing\Entity\EntityListing::class,
62 $this->getUIFactory()->listing()->entity()->standard($this->getEntityMapping())
63 );
64 }

References getEntityMapping(), getUIFactory(), ILIAS\Repository\listing(), and ILIAS\UI\examples\MainControls\Slate\Notification\standard().

+ Here is the call graph for this function:

◆ testEntityListingYieldingEntities()

EntityListingTest::testEntityListingYieldingEntities ( )

Definition at line 66 of file EntityListingTest.php.

66 : void
67 {
68 $data = new class () implements I\Listing\Entity\DataRetrieval {
69 protected $data = [1,2,3];
70
71 public function getEntities(
72 I\Listing\Entity\Mapping $mapping,
74 ?array $additional_parameters
75 ): \Generator {
76 foreach ($this->data as $entry) {
77 yield $mapping->map($entry);
78 }
79 }
80 };
81
82 $listing = $this->getUIFactory()->listing()->entity()
83 ->standard($this->getEntityMapping())
84 ->withData($data);
85
86 $entities = iterator_to_array($listing->getEntities($this->getUIFactory()));
87
88 $this->assertCount(3, $entities);
89
90 $this->assertInstanceOf(I\Entity\Entity::class, array_pop($entities));
91 }
A simple class to express a naive range of whole positive numbers.
Definition: Range.php:29

References $data, ILIAS\UI\Implementation\Component\Table\$range, getEntityMapping(), and getUIFactory().

+ Here is the call graph for this function:

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