41 protected function setUp(): void
44 $this->info_resolver = $this->createMock(InfoResolver::class);
45 $this->resource =
new StorableFileResource($this->id_generator->getUniqueResourceIdentification());
56 $this->info_resolver->expects($this->once())
57 ->method(
'getNextVersionNumber')
61 $revision = $ar_revision_repo->blankFromUpload(
67 $this->assertEquals(100, $revision->getVersionNumber());
73 $i = random_int(0, mt_getrandmax());
75 $this->info_resolver->expects($this->once())
76 ->method(
'getNextVersionNumber')
80 $revision = $ar_revision_repo->blankFromStream(
86 $this->assertEquals(
$i, $revision->getVersionNumber());
92 $old_revisions_id = 99;
93 $revision->setVersionNumber($old_revisions_id);
96 $this->info_resolver->expects($this->once())
97 ->method(
'getNextVersionNumber')
101 $revision = $ar_revision_repo->blankFromClone(
102 $this->info_resolver,
107 $this->assertEquals(
$i, $revision->getVersionNumber());
108 $this->assertNotEquals($old_revisions_id, $revision->getVersionNumber());
Class ResourceBuilderTest.
Class ResourceBuilderTest.
Class RevisionDBRepository.
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...
getDummyFileRevision(ResourceIdentification $id)
Class StorableFileResource.
getDummyUploadResult(string $file_name, string $mime_type, int $size)
PHPUnit Framework MockObject MockObject $info_resolver