55 protected function setUp(): void
59 $this->resource_builder = $this->createMock(ResourceBuilder::class);
60 $this->collection_builder = $this->createMock(CollectionBuilder::class);
68 $this->resource_one = $this->createMock(StorableFileResource::class);
69 $this->revision_one = $this->createMock(Revision::class);
72 $this->resource_two = $this->createMock(StorableFileResource::class);
73 $this->revision_two = $this->createMock(Revision::class);
76 $this->resource_three = $this->createMock(StorableFileResource::class);
77 $this->revision_three = $this->createMock(Revision::class);
79 $this->sorter =
new Sorter(
80 $this->resource_builder,
81 $this->collection_builder,
86 $this->collection->add($this->rid_one);
87 $this->collection->add($this->rid_two);
88 $this->collection->add($this->rid_three);
91 $this->resource_one->expects($this->atLeastOnce())
92 ->method(
'getCurrentRevision')
93 ->willReturn($this->revision_one);
95 $this->resource_two->expects($this->atLeastOnce())
96 ->method(
'getCurrentRevision')
97 ->willReturn($this->revision_two);
99 $this->resource_three->expects($this->atLeastOnce())
100 ->method(
'getCurrentRevision')
101 ->willReturn($this->revision_three);
113 $this->resource_builder->expects($this->atLeastOnce())
115 ->will($this->returnValueMap($map));
120 $this->revision_one->expects($this->atLeastOnce())
121 ->method(
'getInformation')
123 $this->revision_two->expects($this->atLeastOnce())
124 ->method(
'getInformation')
126 $this->revision_three->expects($this->atLeastOnce())
127 ->method(
'getInformation')
128 ->willReturn($three);
139 $sorted_collection = $this->sorter->desc()->bySize();
142 $this->rid_three->serialize(),
143 $this->rid_two->serialize(),
144 $this->rid_one->serialize()
158 $sorted_collection = $this->sorter->asc()->bySize();
161 $this->rid_one->serialize(),
162 $this->rid_two->serialize(),
163 $this->rid_three->serialize(),
177 $sorted_collection = $this->sorter->bySize();
180 $this->rid_one->serialize(),
181 $this->rid_two->serialize(),
182 $this->rid_three->serialize(),
196 $sorted_collection = $this->sorter->byCreationDate();
199 $this->rid_one->serialize(),
200 $this->rid_two->serialize(),
201 $this->rid_three->serialize(),
215 $sorted_collection = $this->sorter->asc()->byCreationDate();
218 $this->rid_one->serialize(),
219 $this->rid_two->serialize(),
220 $this->rid_three->serialize(),
234 $sorted_collection = $this->sorter->desc()->byCreationDate();
237 $this->rid_three->serialize(),
238 $this->rid_two->serialize(),
239 $this->rid_one->serialize(),
253 $sorted_collection = $this->sorter->byTitle();
256 $this->rid_one->serialize(),
257 $this->rid_two->serialize(),
258 $this->rid_three->serialize(),
272 $sorted_collection = $this->sorter->asc()->byTitle();
275 $this->rid_one->serialize(),
276 $this->rid_two->serialize(),
277 $this->rid_three->serialize(),
291 $sorted_collection = $this->sorter->desc()->byTitle();
294 $this->rid_three->serialize(),
295 $this->rid_two->serialize(),
296 $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