ILIAS  release_8 Revision v8.19
All Data Structures Namespaces Files Functions Variables Modules Pages
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
 
 $collection_repository
 
 $revision_repository
 
 $storage_handler
 
ILIAS ResourceStorage Resource ResourceBuilder $resource_builder
 
 $stakeholder_repository
 
 $locking
 
 $storage_handler_factory
 
 $stream_access
 
Repositories $repositories
 
- Protected Attributes inherited from ILIAS\ResourceStorage\AbstractBaseTest
ILIAS ResourceStorage DummyIDGenerator $id_generator
 
 $db_mock
 

Detailed Description

Member Function Documentation

◆ testNewUpload()

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

Definition at line 29 of file ResourceBuilderTest.php.

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

29  : void
30  {
31  // EXPECTED VALUES
32  $expected_file_name = 'info.xml';
33  $expected_owner_id = 6;
34  $expected_version_number = 99;
35  $expected_mime_type = 'text/xml';
36  $expected_size = 128;
37 
38  $resource_builder = new ResourceBuilder(
39  $this->storage_handler_factory,
40  $this->repositories,
41  $this->locking,
42  $this->stream_access
43  );
44 
45  // MOCK
46  [$upload_result, $info_resolver, $identification] = $this->mockResourceAndRevision(
47  $expected_file_name,
48  $expected_mime_type,
49  $expected_size,
50  $expected_version_number,
51  $expected_owner_id
52  );
53 
54  // RUN
55  $resource = $resource_builder->new(
57  $info_resolver
58  );
59 
60  $this->assertEquals($identification->serialize(), $resource->getIdentification()->serialize());
61  $this->assertEquals($expected_version_number, $resource->getCurrentRevision()->getVersionNumber());
62  $this->assertEquals($expected_version_number, $resource->getMaxRevision());
63  $this->assertEquals($expected_file_name, $resource->getCurrentRevision()->getTitle());
64  $this->assertEquals($expected_owner_id, $resource->getCurrentRevision()->getOwnerId());
65  $this->assertEquals($expected_file_name, $resource->getCurrentRevision()->getInformation()->getTitle());
66  $this->assertEquals($expected_mime_type, $resource->getCurrentRevision()->getInformation()->getMimeType());
67  $this->assertEquals($expected_size, $resource->getCurrentRevision()->getInformation()->getSize());
68  }
ILIAS ResourceStorage Resource ResourceBuilder $resource_builder
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: