ILIAS
trunk Revision v11.0_alpha-1843-g9e1fad99175
◀ ilDoc Overview
Main Page
Related Pages
Modules
+
Namespaces
Namespace List
+
Namespace Members
+
All
$
_
a
b
c
d
e
f
g
h
i
j
k
l
m
n
o
p
q
r
s
t
u
v
w
x
y
z
+
Functions
_
a
b
c
d
e
f
g
h
i
k
l
m
n
o
p
r
s
t
u
v
w
x
+
Variables
$
c
e
g
h
j
l
m
p
s
t
u
v
+
Enumerations
a
c
e
f
i
j
l
m
n
o
p
r
s
t
u
v
z
+
Enumerator
a
c
d
e
f
g
i
l
m
n
o
p
q
s
t
u
v
y
+
Data Structures
Data Structures
Data Structure Index
Class Hierarchy
+
Data Fields
+
All
$
_
a
b
c
d
e
f
g
h
i
j
k
l
m
n
o
p
q
r
s
t
u
v
w
x
y
z
Ö
+
Functions
_
a
b
c
d
e
f
g
h
i
j
k
l
m
n
o
p
q
r
s
t
u
v
w
x
y
z
+
Variables
$
_
a
b
c
d
e
f
g
h
i
j
k
l
m
n
o
p
q
r
s
t
u
v
w
x
y
z
Ö
Enumerations
Enumerator
+
Files
File List
+
Globals
+
All
$
a
b
c
d
e
f
g
h
i
l
m
n
o
p
r
s
t
u
v
z
+
Functions
a
b
c
d
e
f
g
h
i
m
n
p
r
s
t
u
v
+
Variables
$
a
c
e
g
h
i
m
n
o
p
r
s
t
u
v
z
Enumerations
Enumerator
Examples
•
All
Data Structures
Namespaces
Files
Functions
Variables
Enumerations
Enumerator
Modules
Pages
FilenameOverridePreProcessorTest.php
Go to the documentation of this file.
1
<?php
2
19
namespace
ILIAS\FileUpload\Processor
;
20
21
use
PHPUnit\Framework\Attributes\BackupGlobals
;
22
use
PHPUnit\Framework\Attributes\BackupStaticProperties
;
23
use
PHPUnit\Framework\Attributes\PreserveGlobalState
;
24
use
PHPUnit\Framework\Attributes\RunTestsInSeparateProcesses
;
25
use
PHPUnit\Framework\Attributes\Test
;
26
use
PHPUnit\Framework\Attributes\Small
;
27
28
require_once(
'./vendor/composer/vendor/autoload.php'
);
29
30
use
ILIAS\Filesystem\Stream\Streams
;
31
use
ILIAS\FileUpload\DTO\Metadata
;
32
use
ILIAS\FileUpload\DTO\ProcessingStatus
;
33
use
PHPUnit\Framework\TestCase
;
34
40
#[BackupGlobals(false)]
41
#[BackupStaticProperties(false)]
42
#[PreserveGlobalState(false)]
43
#[RunTestsInSeparateProcesses]
44
class
FilenameOverridePreProcessorTest
extends
TestCase
45
{
46
#[Test]
47
48
public
function
testProcessWhichShouldSucceed
(): void
49
{
50
$filename
=
'renamed.ogg'
;
51
52
$subject =
new
FilenameSanitizerPreProcessor
(
$filename
);
53
$stream =
Streams::ofString
(
'Awesome stuff'
);
54
$result = $subject->process($stream,
new
Metadata
(
$filename
, $stream->getSize(),
'audio/ogg'
));
55
56
$this->assertSame(
ProcessingStatus::OK
, $result->getCode());
57
$this->assertSame(
'Filename changed'
, $result->getMessage());
58
}
59
}
RunTestsInSeparateProcesses
BackupGlobals
ILIAS\MetaData\Repository\Validation\Processor\FilenameOverridePreProcessorTest\testProcessWhichShouldSucceed
testProcessWhichShouldSucceed()
Definition:
FilenameOverridePreProcessorTest.php:48
PHPUnit::Framework::Attributes\Test
ProcessingStatus
PreserveGlobalState
ILIAS\FileUpload\Processor
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...
Definition:
AbstractRecursiveZipPreProcessor.php:19
$filename
$filename
Definition:
buildRTE.php:78
ILIAS\Filesystem\Stream\Streams\ofString
static ofString(string $string)
Creates a new stream with an initial value.
Definition:
Streams.php:41
BackupStaticProperties
ILIAS\FileUpload\DTO\Metadata
ILIAS\MetaData\Repository\Validation\Processor\FilenameSanitizerPreProcessor
Class FilenameSanitizerPreProcessor.
Definition:
FilenameSanitizerPreProcessor.php:35
Streams
ILIAS\MetaData\Repository\Validation\Processor\FilenameOverridePreProcessorTest
Class FilenameOverridePreProcessorTest.
Definition:
FilenameOverridePreProcessorTest.php:44
ServicesInterface
Small
TestCase
ILIAS\FileUpload\DTO\ProcessingStatus\OK
const OK
Definition:
ProcessingStatus.php:40
components
ILIAS
FileUpload
tests
Processor
FilenameOverridePreProcessorTest.php
Generated on Thu Apr 17 2025 23:02:51 for ILIAS by
1.8.13 (using
Doxyfile
)