ILIAS  release_8 Revision v8.24
AbstractBaseTest.php
Go to the documentation of this file.
1<?php
2
19namespace ILIAS\ResourceStorage;
20
22require_once('DummyIDGenerator.php');
23
31use PHPUnit\Framework\TestCase;
32
37abstract 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}
$id
plugin.php for ilComponentBuildPluginInfoObjectiveTest::testAddPlugins
Definition: plugin.php:23
static ofString(string $string)
Creates a new stream with an initial value.
Definition: Streams.php:43
getDummyUploadResult(string $file_name, string $mime_type, int $size)
getDummyFileRevision(ResourceIdentification $id)
ILIAS ResourceStorage DummyIDGenerator $id_generator
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...
Class ChatMainBarProvider \MainMenu\Provider.