test fixes

This commit is contained in:
Dennis Eichhorn 2022-09-30 15:41:54 +02:00
parent 5cfa5f5a95
commit 634cc3d505
5 changed files with 448 additions and 376 deletions

View File

@ -291,7 +291,11 @@ final class StringUtils
}
// @todo: this should not be necessary
return \str_replace(['<ins></ins>', '<del></del>', '</ins><ins>', '</del><del>'], ['', '', '', ''], $result);
return \str_replace(
['</del></del>', '</ins></ins>', '<ins></ins>', '<del></del>', '</ins><ins>', '</del><del>', '</ins> <del>', '</del> <ins>'],
['', '', '', '', '', '', '</ins><del>', '</del><ins>'],
$result
);
}
/**

View File

@ -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);

View File

@ -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();
}

View File

@ -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'));
}
/**

File diff suppressed because it is too large Load Diff