diff --git a/Utils/StringUtils.php b/Utils/StringUtils.php
index c4f281a03..d3816beff 100644
--- a/Utils/StringUtils.php
+++ b/Utils/StringUtils.php
@@ -291,7 +291,11 @@ final class StringUtils
}
// @todo: this should not be necessary
- return \str_replace(['', '', '', ''], ['', '', '', ''], $result);
+ return \str_replace(
+ ['', '', '', '', '', '', ' ', ' '],
+ ['', '', '', '', '', '', '', ''],
+ $result
+ );
}
/**
diff --git a/Views/View.php b/Views/View.php
index c383c0b14..1a2bdb842 100644
--- a/Views/View.php
+++ b/Views/View.php
@@ -274,12 +274,12 @@ class View extends ViewAbstract
$start = $start + \strlen($match);
if (\strlen($this->template) < $start) {
- throw new InvalidModuleException($this->template);
+ throw new InvalidThemeException($this->template);
}
$end = \strpos($this->template, '/', $start);
if ($end === false) {
- throw new InvalidModuleException($this->template);
+ throw new InvalidThemeException($this->template);
}
$this->theme = \substr($this->template, $start, $end - $start);
diff --git a/tests/Message/Mail/MailHandlerSmtpTrait.php b/tests/Message/Mail/MailHandlerSmtpTrait.php
index c81cade82..8d2156e9c 100644
--- a/tests/Message/Mail/MailHandlerSmtpTrait.php
+++ b/tests/Message/Mail/MailHandlerSmtpTrait.php
@@ -33,7 +33,10 @@ trait MailHandlerSmtpTrait
$smtp = new Smtp();
$this->handler->smtp = $smtp;
- if ($this->handler->mailerTool !== '' && !\file_exists(\explode(' ', $this->handler->mailerTool)[0])) {
+ if ($this->handler->mailerTool !== ''
+ && !\file_exists(\explode(' ', $this->handler->mailerTool)[0])
+ && ($this->handler->smtp === null || !$this->handler->smtpConnect($this->handler->smtpOptions))
+ ) {
self::markTestSkipped();
}
@@ -66,7 +69,10 @@ trait MailHandlerSmtpTrait
$smtp = new Smtp();
$this->handler->smtp = $smtp;
- if ($this->handler->mailerTool !== '' && !\file_exists(\explode(' ', $this->handler->mailerTool)[0])) {
+ if ($this->handler->mailerTool !== ''
+ && !\file_exists(\explode(' ', $this->handler->mailerTool)[0])
+ && ($this->handler->smtp === null || !$this->handler->smtpConnect($this->handler->smtpOptions))
+ ) {
self::markTestSkipped();
}
@@ -104,7 +110,10 @@ trait MailHandlerSmtpTrait
$smtp = new Smtp();
$this->handler->smtp = $smtp;
- if ($this->handler->mailerTool !== '' && !\file_exists(\explode(' ', $this->handler->mailerTool)[0])) {
+ if ($this->handler->mailerTool !== ''
+ && !\file_exists(\explode(' ', $this->handler->mailerTool)[0])
+ && ($this->handler->smtp === null || !$this->handler->smtpConnect($this->handler->smtpOptions))
+ ) {
self::markTestSkipped();
}
@@ -131,7 +140,10 @@ trait MailHandlerSmtpTrait
$smtp = new Smtp();
$this->handler->smtp = $smtp;
- if ($this->handler->mailerTool !== '' && !\file_exists(\explode(' ', $this->handler->mailerTool)[0])) {
+ if ($this->handler->mailerTool !== ''
+ && !\file_exists(\explode(' ', $this->handler->mailerTool)[0])
+ && ($this->handler->smtp === null || !$this->handler->smtpConnect($this->handler->smtpOptions))
+ ) {
self::markTestSkipped();
}
@@ -156,7 +168,10 @@ trait MailHandlerSmtpTrait
$smtp = new Smtp();
$this->handler->smtp = $smtp;
- if ($this->handler->mailerTool !== '' && !\file_exists(\explode(' ', $this->handler->mailerTool)[0])) {
+ if ($this->handler->mailerTool !== ''
+ && !\file_exists(\explode(' ', $this->handler->mailerTool)[0])
+ && ($this->handler->smtp === null || !$this->handler->smtpConnect($this->handler->smtpOptions))
+ ) {
self::markTestSkipped();
}
@@ -181,7 +196,10 @@ trait MailHandlerSmtpTrait
$smtp = new Smtp();
$this->handler->smtp = $smtp;
- if ($this->handler->mailerTool !== '' && !\file_exists(\explode(' ', $this->handler->mailerTool)[0])) {
+ if ($this->handler->mailerTool !== ''
+ && !\file_exists(\explode(' ', $this->handler->mailerTool)[0])
+ && ($this->handler->smtp === null || !$this->handler->smtpConnect($this->handler->smtpOptions))
+ ) {
self::markTestSkipped();
}
@@ -209,7 +227,10 @@ trait MailHandlerSmtpTrait
$smtp = new Smtp();
$this->handler->smtp = $smtp;
- if ($this->handler->mailerTool !== '' && !\file_exists(\explode(' ', $this->handler->mailerTool)[0])) {
+ if ($this->handler->mailerTool !== ''
+ && !\file_exists(\explode(' ', $this->handler->mailerTool)[0])
+ && ($this->handler->smtp === null || !$this->handler->smtpConnect($this->handler->smtpOptions))
+ ) {
self::markTestSkipped();
}
@@ -235,7 +256,10 @@ trait MailHandlerSmtpTrait
$smtp = new Smtp();
$this->handler->smtp = $smtp;
- if ($this->handler->mailerTool !== '' && !\file_exists(\explode(' ', $this->handler->mailerTool)[0])) {
+ if ($this->handler->mailerTool !== ''
+ && !\file_exists(\explode(' ', $this->handler->mailerTool)[0])
+ && ($this->handler->smtp === null || !$this->handler->smtpConnect($this->handler->smtpOptions))
+ ) {
self::markTestSkipped();
}
@@ -260,7 +284,10 @@ trait MailHandlerSmtpTrait
$smtp = new Smtp();
$this->handler->smtp = $smtp;
- if ($this->handler->mailerTool !== '' && !\file_exists(\explode(' ', $this->handler->mailerTool)[0])) {
+ if ($this->handler->mailerTool !== ''
+ && !\file_exists(\explode(' ', $this->handler->mailerTool)[0])
+ && ($this->handler->smtp === null || !$this->handler->smtpConnect($this->handler->smtpOptions))
+ ) {
self::markTestSkipped();
}
@@ -286,7 +313,10 @@ trait MailHandlerSmtpTrait
$smtp = new Smtp();
$this->handler->smtp = $smtp;
- if ($this->handler->mailerTool !== '' && !\file_exists(\explode(' ', $this->handler->mailerTool)[0])) {
+ if ($this->handler->mailerTool !== ''
+ && !\file_exists(\explode(' ', $this->handler->mailerTool)[0])
+ && ($this->handler->smtp === null || !$this->handler->smtpConnect($this->handler->smtpOptions))
+ ) {
self::markTestSkipped();
}
@@ -316,7 +346,10 @@ trait MailHandlerSmtpTrait
$smtp = new Smtp();
$this->handler->smtp = $smtp;
- if ($this->handler->mailerTool !== '' && !\file_exists(\explode(' ', $this->handler->mailerTool)[0])) {
+ if ($this->handler->mailerTool !== ''
+ && !\file_exists(\explode(' ', $this->handler->mailerTool)[0])
+ && ($this->handler->smtp === null || !$this->handler->smtpConnect($this->handler->smtpOptions))
+ ) {
self::markTestSkipped();
}
@@ -346,7 +379,10 @@ trait MailHandlerSmtpTrait
$smtp = new Smtp();
$this->handler->smtp = $smtp;
- if ($this->handler->mailerTool !== '' && !\file_exists(\explode(' ', $this->handler->mailerTool)[0])) {
+ if ($this->handler->mailerTool !== ''
+ && !\file_exists(\explode(' ', $this->handler->mailerTool)[0])
+ && ($this->handler->smtp === null || !$this->handler->smtpConnect($this->handler->smtpOptions))
+ ) {
self::markTestSkipped();
}
@@ -407,7 +443,10 @@ trait MailHandlerSmtpTrait
$smtp = new Smtp();
$this->handler->smtp = $smtp;
- if ($this->handler->mailerTool !== '' && !\file_exists(\explode(' ', $this->handler->mailerTool)[0])) {
+ if ($this->handler->mailerTool !== ''
+ && !\file_exists(\explode(' ', $this->handler->mailerTool)[0])
+ && ($this->handler->smtp === null || !$this->handler->smtpConnect($this->handler->smtpOptions))
+ ) {
self::markTestSkipped();
}
diff --git a/tests/Uri/ArgumentTest.php b/tests/Uri/ArgumentTest.php
index 42a7d3b14..59b4f2fac 100644
--- a/tests/Uri/ArgumentTest.php
+++ b/tests/Uri/ArgumentTest.php
@@ -185,7 +185,7 @@ final class ArgumentTest extends \PHPUnit\Framework\TestCase
self::assertEquals('?para1=abc ?para2=2 #frag', $obj->getQuery());
self::assertEquals(['?para1=abc', '?para2=2', '#frag'], $obj->getQueryArray());
- self::assertEquals('?para1=abc', $obj->getQuery('1'));
+ self::assertEquals('?para2=2', $obj->getQuery('1'));
}
/**
diff --git a/tests/coverage.xml b/tests/coverage.xml
index 2308ec344..6828db727 100644
--- a/tests/coverage.xml
+++ b/tests/coverage.xml
@@ -1,6 +1,6 @@
-
-
+
+
@@ -425,7 +425,7 @@
-
+
@@ -447,7 +447,7 @@
-
+
@@ -468,8 +468,8 @@
-
-
+
+
@@ -501,7 +501,7 @@
-
+
@@ -14437,7 +14437,7 @@
-
+
@@ -14450,7 +14450,7 @@
-
+
@@ -14462,8 +14462,8 @@
-
-
+
+
@@ -14523,7 +14523,7 @@
-
+
@@ -15238,7 +15238,7 @@
-
+
@@ -15381,163 +15381,165 @@
-
+
-
-
-
-
-
+
+
+
+
+
-
-
-
+
+
+
-
-
-
-
-
+
+
+
+
+
-
-
+
+
+
-
-
-
+
+
-
+
-
+
-
-
-
+
+
+
-
-
-
-
-
-
-
-
+
+
+
+
+
+
+
+
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
-
-
-
+
+
+
-
-
-
-
+
+
+
+
-
-
-
-
-
-
-
+
+
+
+
+
+
+
-
-
-
+
+
+
-
-
-
-
-
-
-
-
-
-
+
+
+
+
+
+
+
+
+
+
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
-
-
-
+
+
+
-
-
-
-
-
+
+
+
+
+
-
-
-
-
-
-
-
-
-
+
+
+
+
+
+
+
+
+
-
-
+
+
+
+
@@ -16604,7 +16606,7 @@
-
+
@@ -16650,15 +16652,15 @@
-
+
-
-
+
+
-
-
+
+
@@ -16669,7 +16671,7 @@
-
+
@@ -20051,7 +20053,7 @@
-
+
@@ -20099,7 +20101,7 @@
-
+
@@ -20118,8 +20120,8 @@
-
-
+
+
@@ -20142,7 +20144,7 @@
-
+
@@ -20154,11 +20156,11 @@
-
+
-
+
@@ -20244,7 +20246,7 @@
-
+
@@ -20304,17 +20306,17 @@
-
+
-
+
-
+
@@ -20334,63 +20336,65 @@
-
-
-
-
-
-
-
-
+
+
+
+
+
+
-
+
-
+
+
-
+
-
-
+
+
+
-
-
-
+
+
+
-
-
+
+
-
-
+
-
-
-
-
-
-
+
+
+
+
+
+
-
-
-
-
+
+
+
+
+
-
-
+
-
+
+
-
+
+
+
@@ -20400,15 +20404,17 @@
-
+
-
+
-
-
-
+
+
+
+
-
+
+
@@ -20729,9 +20735,9 @@
-
+
-
+
@@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