51 protected function setUp(): void
55 $this->resource_builder = $this->createMock(ResourceBuilder::class);
56 $collection_builder = $this->createMock(CollectionBuilder::class);
64 $resource_one = $this->createMock(StorableFileResource::class);
65 $this->revision_one = $this->createMock(Revision::class);
68 $resource_two = $this->createMock(StorableFileResource::class);
69 $this->revision_two = $this->createMock(Revision::class);
72 $resource_three = $this->createMock(StorableFileResource::class);
73 $this->revision_three = $this->createMock(Revision::class);
75 $this->sorter =
new Sorter(
76 $this->resource_builder,
82 $collection->add($this->rid_one);
83 $collection->add($this->rid_two);
84 $collection->add($this->rid_three);
87 $resource_one->expects($this->atLeastOnce())
88 ->method(
'getCurrentRevision')
89 ->willReturn($this->revision_one);
91 $resource_two->expects($this->atLeastOnce())
92 ->method(
'getCurrentRevision')
93 ->willReturn($this->revision_two);
95 $resource_three->expects($this->atLeastOnce())
96 ->method(
'getCurrentRevision')
97 ->willReturn($this->revision_three);
105 $this->resource_builder->expects($this->atLeastOnce())
107 ->willReturnMap($map);
112 $this->revision_one->expects($this->atLeastOnce())
113 ->method(
'getInformation')
115 $this->revision_two->expects($this->atLeastOnce())
116 ->method(
'getInformation')
118 $this->revision_three->expects($this->atLeastOnce())
119 ->method(
'getInformation')
120 ->willReturn($three);
131 $sorted_collection = $this->sorter->desc()->bySize();
134 $this->rid_three->serialize(),
135 $this->rid_two->serialize(),
136 $this->rid_one->serialize()
150 $sorted_collection = $this->sorter->asc()->bySize();
153 $this->rid_one->serialize(),
154 $this->rid_two->serialize(),
155 $this->rid_three->serialize(),
169 $sorted_collection = $this->sorter->bySize();
172 $this->rid_one->serialize(),
173 $this->rid_two->serialize(),
174 $this->rid_three->serialize(),
188 $sorted_collection = $this->sorter->byCreationDate();
191 $this->rid_one->serialize(),
192 $this->rid_two->serialize(),
193 $this->rid_three->serialize(),
207 $sorted_collection = $this->sorter->asc()->byCreationDate();
210 $this->rid_one->serialize(),
211 $this->rid_two->serialize(),
212 $this->rid_three->serialize(),
226 $sorted_collection = $this->sorter->desc()->byCreationDate();
229 $this->rid_three->serialize(),
230 $this->rid_two->serialize(),
231 $this->rid_one->serialize(),
245 $sorted_collection = $this->sorter->byTitle();
248 $this->rid_one->serialize(),
249 $this->rid_two->serialize(),
250 $this->rid_three->serialize(),
264 $sorted_collection = $this->sorter->asc()->byTitle();
267 $this->rid_one->serialize(),
268 $this->rid_two->serialize(),
269 $this->rid_three->serialize(),
283 $sorted_collection = $this->sorter->desc()->byTitle();
286 $this->rid_three->serialize(),
287 $this->rid_two->serialize(),
288 $this->rid_one->serialize(),
testByCreationDateAscSorting()
Class AbstractBaseResourceBuilderTestCase.
ResourceIdentification $rid_three
Class ResourceCollectionIdentification.
Class ResourceCollection.
Class CollectionSortingTest.
testByCreationDateDescSorting()
Class ResourceIdentification.
MockObject $revision_three
ResourceIdentification $rid_one
getResourceIdentifications()
getFlatOrder(ResourceCollection $collection)
ResourceIdentification $rid_two
Class CollectionIdentificationGenerator.
testBySizeDefaultSorting()
testByTitleDefaultSorting()
testByCreationDateDefaultSorting()
setUpRevisionExpectations(FileInformation $one, FileInformation $two, FileInformation $three)
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...
CollectionIdentificationGenerator $rcid_generator