ILIAS
release_5-3 Revision v5.3.23-19-g915713cf615
◀ ilDoc Overview
FilenameOverridePreProcessorTest.php
Go to the documentation of this file.
1
<?php
2
3
namespace
ILIAS\FileUpload\Processor
;
4
5
require_once(
'./libs/composer/vendor/autoload.php'
);
6
7
use
ILIAS\Filesystem\Stream\Streams
;
8
use
ILIAS\FileUpload\DTO\Metadata
;
9
use
ILIAS\FileUpload\DTO\ProcessingStatus
;
10
use
PHPUnit\Framework\TestCase
;
11
22
class
FilenameOverridePreProcessorTest
extends
TestCase
23
{
24
29
public
function
testProcessWhichShouldSucceed
()
30
{
31
$filename
=
'renamed.ogg'
;
32
33
$subject =
new
FilenameOverridePreProcessor
(
$filename
);
34
$stream
=
Streams::ofString
(
'Awesome stuff'
);
35
$result
= $subject->process(
$stream
,
new
Metadata
(
$filename
,
$stream
->getSize(),
'audio/ogg'
));
36
37
$this->assertSame(
ProcessingStatus::OK
,
$result
->getCode());
38
$this->assertSame(
'Filename changed'
,
$result
->getMessage());
39
}
40
}
ILIAS\FileUpload\Processor\FilenameOverridePreProcessorTest\testProcessWhichShouldSucceed
testProcessWhichShouldSucceed()
Definition:
FilenameOverridePreProcessorTest.php:29
$result
$result
Definition:
CleanUpTest.php:463
GuzzleHttp\Psr7\$stream
$stream
PHP stream implementation.
Definition:
MessageTrait.php:21
$filename
$filename
Definition:
33chartcreate-stock.php:138
ProcessingStatus
ILIAS\FileUpload\Processor
Definition:
BlacklistExtensionPreProcessor.php:3
ILIAS\FileUpload\DTO\Metadata
Class Metadata.
Definition:
Metadata.php:21
ILIAS\FileUpload\Processor\FilenameOverridePreProcessor
Class FilenameOverridePreProcessor.
Definition:
FilenameOverridePreProcessor.php:18
ILIAS\Filesystem\Stream\Streams\ofString
static ofString($string)
Creates a new stream with an initial value.
Definition:
Streams.php:29
Metadata
Streams
ILIAS\FileUpload\Processor\FilenameOverridePreProcessorTest
Class FilenameOverridePreProcessorTest.
Definition:
FilenameOverridePreProcessorTest.php:22
TestCase
ILIAS\FileUpload\DTO\ProcessingStatus\OK
const OK
Upload is ok.
Definition:
ProcessingStatus.php:26
tests
FileUpload
Processor
FilenameOverridePreProcessorTest.php
Generated on Sat Jan 18 2025 19:01:43 for ILIAS by
1.8.13 (using
Doxyfile
)