ILIAS  release_8 Revision v8.19
All Data Structures Namespaces Files Functions Variables Modules Pages
AbstractBaseTest.php
Go to the documentation of this file.
1 <?php
2 
19 namespace ILIAS\ResourceStorage;
20 
22 require_once('DummyIDGenerator.php');
23 
32 
37 abstract class AbstractBaseTest extends TestCase
38 {
39  protected \ILIAS\ResourceStorage\DummyIDGenerator $id_generator;
43  protected $db_mock;
44 
48  protected function setUp(): void
49  {
50  parent::setUp();
51  $this->id_generator = new DummyIDGenerator();
52  $this->db_mock = $this->getMockBuilder(\ilDBInterface::class)->getMock();
53  }
54 
55  protected function getDummyUploadResult(string $file_name, string $mime_type, int $size): UploadResult
56  {
57  return new UploadResult(
58  $file_name,
59  $size,
60  $mime_type,
62  new ProcessingStatus(ProcessingStatus::OK, 'No processors were registered.'),
63  'dummy/path'
64  );
65  }
66 
67  public function getDummyStream(): FileStream
68  {
69  return Streams::ofString('dummy_content');
70  }
71 
73  {
74  return new FileRevision($id);
75  }
76 }
Class ChatMainBarProvider .
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...
static ofString(string $string)
Creates a new stream with an initial value.
Definition: Streams.php:43
getDummyFileRevision(ResourceIdentification $id)
ILIAS ResourceStorage DummyIDGenerator $id_generator
$id
plugin.php for ilComponentBuildPluginInfoObjectiveTest::testAddPlugins
Definition: plugin.php:23
getDummyUploadResult(string $file_name, string $mime_type, int $size)
Interface FileStream.
Definition: FileStream.php:33