23 require_once(__DIR__ .
"/../AbstractTestBase.php");
46 protected function setUp(): void
49 $this->info_resolver = $this->createMock(InfoResolver::class);
50 $this->resource =
new StorableFileResource($this->id_generator->getUniqueResourceIdentification());
61 $this->info_resolver->expects($this->once())
62 ->method(
'getNextVersionNumber')
66 $revision = $ar_revision_repo->blankFromUpload(
73 $this->assertEquals(100, $revision->getVersionNumber());
80 $i = random_int(0, mt_getrandmax());
82 $this->info_resolver->expects($this->once())
83 ->method(
'getNextVersionNumber')
87 $revision = $ar_revision_repo->blankFromStream(
91 RevisionStatus::PUBLISHED
94 $this->assertEquals($i, $revision->getVersionNumber());
100 $old_revisions_id = 99;
101 $revision->setVersionNumber($old_revisions_id);
104 $this->info_resolver->expects($this->once())
105 ->method(
'getNextVersionNumber')
109 $revision = $ar_revision_repo->blankFromClone(
110 $this->info_resolver,
115 $this->assertEquals($i, $revision->getVersionNumber());
116 $this->assertNotEquals($old_revisions_id, $revision->getVersionNumber());
getDummyUploadResult(string $file_name, string $mime_type, int $size)
Class ResourceBuilderTest.
getDummyFileRevision(ResourceIdentification $id)
Class RevisionDBRepository.
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...
Class ResourceBuilderTest.
MockObject $info_resolver