ILIAS  trunk Revision v11.0_alpha-3011-gc6b235a2e85
AbstractTestBase.php
Go to the documentation of this file.
1<?php
2
19namespace ILIAS\ResourceStorage;
20
21use PHPUnit\Framework\MockObject\MockObject;
22
24require_once('DummyIDGenerator.php');
25
33use PHPUnit\Framework\TestCase;
34
39abstract class AbstractTestBase extends TestCase
40{
45 protected MockObject $db_mock;
46
50 protected function setUp(): void
51 {
52 parent::setUp();
53 $this->id_generator = new DummyIDGenerator();
54 $this->db_mock = $this->getMockBuilder(\ilDBInterface::class)->getMock();
55 }
56
57 protected function getDummyUploadResult(string $file_name, string $mime_type, int $size): UploadResult
58 {
59 return new UploadResult(
60 $file_name,
61 $size,
62 $mime_type,
64 new ProcessingStatus(ProcessingStatus::OK, 'No processors were registered.'),
65 'dummy/path'
66 );
67 }
68
69 public function getDummyStream(): FileStream
70 {
71 return Streams::ofString('dummy_content');
72 }
73
75 {
76 return new FileRevision($id);
77 }
78}
$id
plugin.php for ilComponentBuildPluginInfoObjectiveTest::testAddPlugins
Definition: plugin.php:23
Stream factory which enables the user to create streams without the knowledge of the concrete class.
Definition: Streams.php:32
static ofString(string $string)
Creates a new stream with an initial value.
Definition: Streams.php:41
getDummyFileRevision(ResourceIdentification $id)
getDummyUploadResult(string $file_name, string $mime_type, int $size)
The base interface for all filesystem streams.
Definition: FileStream.php:32
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...