diff --git a/extension/qfq/qfq/helper/OnString.php b/extension/qfq/qfq/helper/OnString.php
index 071c3ec86f55925c4d1d2440f49aa95307d3705e..9d0706a69b98b928c3cf6347bd56fef4f225ec7a 100644
--- a/extension/qfq/qfq/helper/OnString.php
+++ b/extension/qfq/qfq/helper/OnString.php
@@ -20,6 +20,10 @@ class OnString {
      * @return string
      */
     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);
     }
 }
diff --git a/extension/qfq/tests/phpunit/OnArrayTest.php b/extension/qfq/tests/phpunit/OnArrayTest.php
index f8fa40680ed268d90833944d8210b464019f0448..06ba468fd525e496ca84e55d6cbfad73455c4bbe 100644
--- a/extension/qfq/tests/phpunit/OnArrayTest.php
+++ b/extension/qfq/tests/phpunit/OnArrayTest.php
@@ -12,6 +12,7 @@ require_once(__DIR__ . '/../../qfq/helper/OnArray.php');
 
 
 class OnArrayTest extends \PHPUnit_Framework_TestCase {
+
     public function testSortByKey() {
         $unsorted = [
             'a' => 'z',
diff --git a/extension/qfq/tests/phpunit/OnStringTest.php b/extension/qfq/tests/phpunit/OnStringTest.php
new file mode 100644
index 0000000000000000000000000000000000000000..f73edbc5b8c716e478e0e9381428278bc004c207
--- /dev/null
+++ b/extension/qfq/tests/phpunit/OnStringTest.php
@@ -0,0 +1,31 @@
+<?php
+/**
+ * Created by PhpStorm.
+ * User: crose
+ * Date: 11/02/18
+ * Time: 9:16 PM
+ */
+
+namespace qfq;
+
+require_once(__DIR__ . '/../../qfq/helper/OnString.php');
+
+use qfq;
+
+//use qfq\exceptions\CodeException;
+
+//require_once(__DIR__ . '/../../qfq/store/Store.php');
+//require_once(__DIR__ . '/../../qfq/Constants.php');
+//require_once(__DIR__ . '/../../qfq/exceptions/CodeException.php');
+//
+
+class OnStringTest extends \PHPUnit_Framework_TestCase {
+
+    public function testStrrstr() {
+
+        $this->assertEquals('', OnString::strrstr('', ''));
+        $this->assertEquals('', OnString::strrstr('hello world to the limit', ''));
+        $this->assertEquals('limit', OnString::strrstr('hello world to the limit', ' '));
+        $this->assertEquals('', OnString::strrstr('', ' '));
+    }
+}
\ No newline at end of file
diff --git a/extension/qfq/tests/phpunit/StoreTest.php b/extension/qfq/tests/phpunit/StoreTest.php
index 1ae81431bba6523a62c8d2ad821c80693c2108a7..b5ef6959cbfac19257a7a428a5a3206f45edd790 100644
--- a/extension/qfq/tests/phpunit/StoreTest.php
+++ b/extension/qfq/tests/phpunit/StoreTest.php
@@ -336,6 +336,10 @@ EOT;
 
             DOCUMENTATION_QFQ => DOCUMENTATION_QFQ_URL,
             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);
diff --git a/extension/qfq/tests/phpunit/StringTest.php b/extension/qfq/tests/phpunit/StringTest.php
deleted file mode 100644
index 83bddef13379b179d5a8a8617d881b2b680d880e..0000000000000000000000000000000000000000
--- a/extension/qfq/tests/phpunit/StringTest.php
+++ /dev/null
@@ -1,29 +0,0 @@
-<?php
-/**
- * Created by PhpStorm.
- * User: crose
- * Date: 11/02/18
- * Time: 9:16 PM
- */
-
-namespace qfq;
-
-use qfq;
-
-//use qfq\exceptions\CodeException;
-
-//require_once(__DIR__ . '/../../qfq/store/Store.php');
-//require_once(__DIR__ . '/../../qfq/Constants.php');
-//require_once(__DIR__ . '/../../qfq/exceptions/CodeException.php');
-//
-
-class StringTest extends \PHPUnit_Framework_TestCase {
-
-    public function testStrrstr() {
-
-        $this->assertEquals('', String::strrstr('', ''));
-        $this->assertEquals('', String::strrstr('hello world to the limit', ''));
-        $this->assertEquals('limit', String::strrstr('hello world to the limit', ' '));
-        $this->assertEquals('', String::strrstr('', ' '));
-    }
-}
\ No newline at end of file