56 protected function setUp(): void
60 $this->resource_builder = $this->createMock(ResourceBuilder::class);
61 $this->collection_builder = $this->createMock(CollectionBuilder::class);
69 $this->resource_one = $this->createMock(StorableFileResource::class);
70 $this->revision_one = $this->createMock(Revision::class);
73 $this->resource_two = $this->createMock(StorableFileResource::class);
74 $this->revision_two = $this->createMock(Revision::class);
77 $this->resource_three = $this->createMock(StorableFileResource::class);
78 $this->revision_three = $this->createMock(Revision::class);
80 $this->sorter =
new Sorter(
81 $this->resource_builder,
82 $this->collection_builder,
87 $this->collection->add($this->rid_one);
88 $this->collection->add($this->rid_two);
89 $this->collection->add($this->rid_three);
92 $this->resource_one->expects($this->atLeastOnce())
93 ->method(
'getCurrentRevision')
94 ->willReturn($this->revision_one);
96 $this->resource_two->expects($this->atLeastOnce())
97 ->method(
'getCurrentRevision')
98 ->willReturn($this->revision_two);
100 $this->resource_three->expects($this->atLeastOnce())
101 ->method(
'getCurrentRevision')
102 ->willReturn($this->revision_three);
114 $this->resource_builder->expects($this->atLeastOnce())
116 ->will($this->returnValueMap($map));
121 $this->revision_one->expects($this->atLeastOnce())
122 ->method(
'getInformation')
124 $this->revision_two->expects($this->atLeastOnce())
125 ->method(
'getInformation')
127 $this->revision_three->expects($this->atLeastOnce())
128 ->method(
'getInformation')
129 ->willReturn($three);
140 $sorted_collection = $this->sorter->desc()->bySize();
143 $this->rid_three->serialize(),
144 $this->rid_two->serialize(),
145 $this->rid_one->serialize()
159 $sorted_collection = $this->sorter->asc()->bySize();
162 $this->rid_one->serialize(),
163 $this->rid_two->serialize(),
164 $this->rid_three->serialize(),
178 $sorted_collection = $this->sorter->bySize();
181 $this->rid_one->serialize(),
182 $this->rid_two->serialize(),
183 $this->rid_three->serialize(),
197 $sorted_collection = $this->sorter->byCreationDate();
200 $this->rid_one->serialize(),
201 $this->rid_two->serialize(),
202 $this->rid_three->serialize(),
216 $sorted_collection = $this->sorter->asc()->byCreationDate();
219 $this->rid_one->serialize(),
220 $this->rid_two->serialize(),
221 $this->rid_three->serialize(),
235 $sorted_collection = $this->sorter->desc()->byCreationDate();
238 $this->rid_three->serialize(),
239 $this->rid_two->serialize(),
240 $this->rid_one->serialize(),
254 $sorted_collection = $this->sorter->byTitle();
257 $this->rid_one->serialize(),
258 $this->rid_two->serialize(),
259 $this->rid_three->serialize(),
273 $sorted_collection = $this->sorter->asc()->byTitle();
276 $this->rid_one->serialize(),
277 $this->rid_two->serialize(),
278 $this->rid_three->serialize(),
292 $sorted_collection = $this->sorter->desc()->byTitle();
295 $this->rid_three->serialize(),
296 $this->rid_two->serialize(),
297 $this->rid_one->serialize(),
StorableFileResource $resource_two
testByCreationDateAscSorting()
Class AbstractBaseResourceBuilderTestCase.
StorableFileResource $resource_one
ResourceIdentification $rid_three
Class ResourceCollectionIdentification.
Class ResourceCollection.
Class CollectionSortingTest.
testByCreationDateDescSorting()
Class ResourceIdentification.
ResourceCollection $collection
ResourceIdentification $rid_one
CollectionBuilder $collection_builder
getResourceIdentifications()
getFlatOrder(ResourceCollection $collection)
ResourceIdentification $rid_two
Class CollectionIdentificationGenerator.
ResourceCollectionIdentification $rcid
StorableFileResource $resource_three
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