ILIAS  release_7 Revision v7.30-3-g800a261c036
ILIAS\ResourceStorage\Resource\ResourceBuilderTest Class Reference

Class ResourceBuilderTest. More...

+ Inheritance diagram for ILIAS\ResourceStorage\Resource\ResourceBuilderTest:
+ Collaboration diagram for ILIAS\ResourceStorage\Resource\ResourceBuilderTest:

Public Member Functions

 testNewUpload ()
 
- Public Member Functions inherited from ILIAS\ResourceStorage\AbstractBaseTest
 getDummyStream ()
 

Additional Inherited Members

- Protected Member Functions inherited from ILIAS\ResourceStorage\AbstractBaseResourceBuilderTest
 setUp ()
 
 mockResourceAndRevision (string $expected_file_name, string $expected_mime_type, int $expected_size, int $expected_version_number, int $expected_owner_id)
 
- Protected Member Functions inherited from ILIAS\ResourceStorage\AbstractBaseTest
 setUp ()
 
 getDummyUploadResult (string $file_name, string $mime_type, int $size)
 
 getDummyFileRevision (ResourceIdentification $id)
 
- Protected Attributes inherited from ILIAS\ResourceStorage\AbstractBaseResourceBuilderTest
 $revision
 
 $information
 
 $upload_result
 
 $information_repository
 
 $resource_repository
 
 $revision_repository
 
 $storage_handler
 
 $resource_builder
 
 $stakeholder_repository
 
 $locking
 
 $storage_handler_factory
 
- Protected Attributes inherited from ILIAS\ResourceStorage\AbstractBaseTest
 $id_generator
 
 $db_mock
 

Detailed Description

Member Function Documentation

◆ testNewUpload()

ILIAS\ResourceStorage\Resource\ResourceBuilderTest::testNewUpload ( )

Definition at line 14 of file ResourceBuilderTest.php.

References ILIAS\ResourceStorage\AbstractBaseResourceBuilderTest\$resource_builder, ILIAS\ResourceStorage\AbstractBaseResourceBuilderTest\$upload_result, and ILIAS\ResourceStorage\AbstractBaseResourceBuilderTest\mockResourceAndRevision().

14  : void
15  {
16  // EXPECTED VALUES
17  $expected_file_name = 'info.xml';
18  $expected_owner_id = 6;
19  $expected_version_number = 99;
20  $expected_mime_type = 'text/xml';
21  $expected_size = 128;
22 
23  $resource_builder = new ResourceBuilder(
24  $this->storage_handler_factory,
25  $this->revision_repository,
26  $this->resource_repository,
27  $this->information_repository,
28  $this->stakeholder_repository,
29  $this->locking
30  );
31 
32  // MOCK
33  list($upload_result, $info_resolver, $identification) = $this->mockResourceAndRevision(
34  $expected_file_name,
35  $expected_mime_type,
36  $expected_size, $expected_version_number, $expected_owner_id
37  );
38 
39  // RUN
40  $resource = $resource_builder->new(
42  $info_resolver
43  );
44 
45  $this->assertEquals($identification->serialize(), $resource->getIdentification()->serialize());
46  $this->assertEquals($expected_version_number, $resource->getCurrentRevision()->getVersionNumber());
47  $this->assertEquals($expected_version_number, $resource->getMaxRevision());
48  $this->assertEquals($expected_file_name, $resource->getCurrentRevision()->getTitle());
49  $this->assertEquals($expected_owner_id, $resource->getCurrentRevision()->getOwnerId());
50  $this->assertEquals($expected_file_name, $resource->getCurrentRevision()->getInformation()->getTitle());
51  $this->assertEquals($expected_mime_type, $resource->getCurrentRevision()->getInformation()->getMimeType());
52  $this->assertEquals($expected_size, $resource->getCurrentRevision()->getInformation()->getSize());
53 
54  }
mockResourceAndRevision(string $expected_file_name, string $expected_mime_type, int $expected_size, int $expected_version_number, int $expected_owner_id)
+ Here is the call graph for this function:

The documentation for this class was generated from the following file: