Skip to content
GitLab
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
typo3
qfq
Commits
5d588d86
Commit
5d588d86
authored
Feb 11, 2018
by
Carsten Rose
Browse files
Feature 5333 / Thumbnail: fixed unit tests
parent
208fd77f
Changes
4
Hide whitespace changes
Inline
Side-by-side
extension/qfq/qfq/helper/OnString.php
View file @
5d588d86
...
@@ -20,6 +20,10 @@ class OnString {
...
@@ -20,6 +20,10 @@ class OnString {
* @return string
* @return string
*/
*/
public
static
function
strrstr
(
$haystack
,
$needle
)
{
public
static
function
strrstr
(
$haystack
,
$needle
)
{
return
substr
(
$haystack
,
strpos
(
$haystack
,
$needle
)
+
1
);
if
(
empty
(
$needle
)
||
empty
(
$haystack
))
{
return
''
;
}
return
substr
(
$haystack
,
strrpos
(
$haystack
,
$needle
)
+
1
);
}
}
}
}
extension/qfq/tests/phpunit/OnArrayTest.php
View file @
5d588d86
...
@@ -12,6 +12,7 @@ require_once(__DIR__ . '/../../qfq/helper/OnArray.php');
...
@@ -12,6 +12,7 @@ require_once(__DIR__ . '/../../qfq/helper/OnArray.php');
class
OnArrayTest
extends
\
PHPUnit_Framework_TestCase
{
class
OnArrayTest
extends
\
PHPUnit_Framework_TestCase
{
public
function
testSortByKey
()
{
public
function
testSortByKey
()
{
$unsorted
=
[
$unsorted
=
[
'a'
=>
'z'
,
'a'
=>
'z'
,
...
...
extension/qfq/tests/phpunit/StringTest.php
→
extension/qfq/tests/phpunit/
On
StringTest.php
View file @
5d588d86
...
@@ -8,6 +8,8 @@
...
@@ -8,6 +8,8 @@
namespace
qfq
;
namespace
qfq
;
require_once
(
__DIR__
.
'/../../qfq/helper/OnString.php'
);
use
qfq
;
use
qfq
;
//use qfq\exceptions\CodeException;
//use qfq\exceptions\CodeException;
...
@@ -17,13 +19,13 @@ use qfq;
...
@@ -17,13 +19,13 @@ use qfq;
//require_once(__DIR__ . '/../../qfq/exceptions/CodeException.php');
//require_once(__DIR__ . '/../../qfq/exceptions/CodeException.php');
//
//
class
StringTest
extends
\
PHPUnit_Framework_TestCase
{
class
On
StringTest
extends
\
PHPUnit_Framework_TestCase
{
public
function
testStrrstr
()
{
public
function
testStrrstr
()
{
$this
->
assertEquals
(
''
,
String
::
strrstr
(
''
,
''
));
$this
->
assertEquals
(
''
,
On
String
::
strrstr
(
''
,
''
));
$this
->
assertEquals
(
''
,
String
::
strrstr
(
'hello world to the limit'
,
''
));
$this
->
assertEquals
(
''
,
On
String
::
strrstr
(
'hello world to the limit'
,
''
));
$this
->
assertEquals
(
'limit'
,
String
::
strrstr
(
'hello world to the limit'
,
' '
));
$this
->
assertEquals
(
'limit'
,
On
String
::
strrstr
(
'hello world to the limit'
,
' '
));
$this
->
assertEquals
(
''
,
String
::
strrstr
(
''
,
' '
));
$this
->
assertEquals
(
''
,
On
String
::
strrstr
(
''
,
' '
));
}
}
}
}
\ No newline at end of file
extension/qfq/tests/phpunit/StoreTest.php
View file @
5d588d86
...
@@ -336,6 +336,10 @@ EOT;
...
@@ -336,6 +336,10 @@ EOT;
DOCUMENTATION_QFQ
=>
DOCUMENTATION_QFQ_URL
,
DOCUMENTATION_QFQ
=>
DOCUMENTATION_QFQ_URL
,
SYSTEM_ENTER_AS_SUBMIT
=>
1
,
SYSTEM_ENTER_AS_SUBMIT
=>
1
,
SYSTEM_CMD_INKSCAPE
=>
'inkscape'
,
SYSTEM_CMD_CONVERT
=>
'convert'
,
SYSTEM_THUMBNAIL_DIR_PUBLIC
=>
SYSTEM_THUMBNAIL_DIR_PUBLIC_DEFAULT
,
SYSTEM_THUMBNAIL_DIR_SECURE
=>
SYSTEM_THUMBNAIL_DIR_SECURE_DEFAULT
,
];
];
$fileName
=
$this
->
createFile
(
$body
);
$fileName
=
$this
->
createFile
(
$body
);
...
...
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment