ILIAS  release_7 Revision v7.30-3-g800a261c036
AbstractBaseTest.php
Go to the documentation of this file.
1<?php
2
4
5require_once('DummyIDGenerator.php');
6
7use PHPUnit\Framework\TestCase;
17
22abstract class AbstractBaseTest extends TestCase
23{
27 protected $id_generator;
31 protected $db_mock;
32
36 protected function setUp() : void
37 {
38 parent::setUp();
39 $this->id_generator = new DummyIDGenerator();
40 $this->db_mock = $this->getMockBuilder(\ilDBInterface::class)->getMock();
41 }
42
46 protected function getDummyUploadResult(string $file_name, string $mime_type, int $size) : UploadResult
47 {
48 return new UploadResult(
49 $file_name,
50 $size,
51 $mime_type,
53 new ProcessingStatus(ProcessingStatus::OK, 'No processors were registered.'),
54 'dummy/path'
55 );
56 }
57
58 public function getDummyStream() : FileStream
59 {
60 return Streams::ofString('dummy_content');
61 }
62
64 {
65 return new FileRevision($id);
66 }
67
68}
69
$size
Definition: RandomTest.php:84
An exception for terminatinating execution or to throw for unit testing.
Class Streams Stream factory which enables the user to create streams without the knowledge of the co...
Definition: Streams.php:17
static ofString($string)
Creates a new stream with an initial value.
Definition: Streams.php:25
getDummyUploadResult(string $file_name, string $mime_type, int $size)
getDummyFileRevision(ResourceIdentification $id)
Interface FileStream The base interface for all filesystem streams.
Definition: FileStream.php:18