diff --git a/DataStorage/Database/Query/Grammar/Grammar.php b/DataStorage/Database/Query/Grammar/Grammar.php index 8e6367562..b44be6cad 100644 --- a/DataStorage/Database/Query/Grammar/Grammar.php +++ b/DataStorage/Database/Query/Grammar/Grammar.php @@ -17,6 +17,7 @@ namespace phpOMS\DataStorage\Database\Query\Grammar; use phpOMS\DataStorage\Database\GrammarAbstract; use phpOMS\DataStorage\Database\Query\Builder; use phpOMS\DataStorage\Database\Query\Column; +use phpOMS\DataStorage\Database\Query\From; use phpOMS\DataStorage\Database\Query\Parameter; use phpOMS\DataStorage\Database\Query\QueryType; use phpOMS\DataStorage\Database\Query\Where; @@ -262,7 +263,7 @@ class Grammar extends GrammarAbstract if (isset($element['value'])) { $expression .= ' ' . \strtoupper($element['operator']) . ' ' . $this->compileValue($query, $element['value']); - } elseif (isset($element['value']) && !($element['column'] instanceof Where)) { + } elseif ($element['value'] === null && !($element['column'] instanceof Where)) { $operator = $element['operator'] === '=' ? 'IS' : 'IS NOT'; $expression .= ' ' . $operator . ' ' . $this->compileValue($query, $element['value']); } diff --git a/tests/Bootstrap.php b/tests/Bootstrap.php index fd057e8c0..032704909 100644 --- a/tests/Bootstrap.php +++ b/tests/Bootstrap.php @@ -304,6 +304,8 @@ $GLOBALS['dbpool']->create('schema', $CONFIG['db']['core']['masters']['schema']) DataMapperAbstract::setConnection($GLOBALS['dbpool']->get()); +$GLOBALS['frameworkpath'] = '/'; + function phpServe(): void { // OS detection diff --git a/tests/Message/Http/HttpRequestTest.php b/tests/Message/Http/HttpRequestTest.php index 9a2b846f9..02fdf82a8 100644 --- a/tests/Message/Http/HttpRequestTest.php +++ b/tests/Message/Http/HttpRequestTest.php @@ -386,7 +386,7 @@ class HttpRequestTest extends \PHPUnit\Framework\TestCase */ public function testPostData() : void { - $request = new HttpRequest(new HttpUri('http://localhost:1234/phpOMS/tests/Message/Http/HttpRequestPost.php')); + $request = new HttpRequest(new HttpUri('http://localhost:1234' . $GLOBALS['frameworkpath'] . 'tests/Message/Http/HttpRequestPost.php')); $request->setMethod(RequestMethod::POST); $request->getHeader()->set('Content-Type', MimeType::M_POST); $request->setData('testKey', 'testValue'); @@ -404,7 +404,7 @@ class HttpRequestTest extends \PHPUnit\Framework\TestCase */ public function testJsonData() : void { - $request = new HttpRequest(new HttpUri('http://localhost:1234/phpOMS/tests/Message/Http/HttpRequestPost.php')); + $request = new HttpRequest(new HttpUri('http://localhost:1234' . $GLOBALS['frameworkpath'] . 'tests/Message/Http/HttpRequestPost.php')); $request->setMethod(RequestMethod::POST); $request->getHeader()->set('Content-Type', MimeType::M_JSON); $request->setData('testKey', 'testValue'); @@ -422,7 +422,7 @@ class HttpRequestTest extends \PHPUnit\Framework\TestCase */ public function testMultipartData() : void { - $request = new HttpRequest(new HttpUri('http://localhost:1234/phpOMS/tests/Message/Http/HttpRequestPost.php')); + $request = new HttpRequest(new HttpUri('http://localhost:1234' . $GLOBALS['frameworkpath'] . 'tests/Message/Http/HttpRequestPost.php')); $request->setMethod(RequestMethod::POST); $request->getHeader()->set('Content-Type', MimeType::M_MULT); $request->setData('testKey', 'testValue'); @@ -440,7 +440,7 @@ class HttpRequestTest extends \PHPUnit\Framework\TestCase */ public function testLanguage() : void { - $request = new HttpRequest(new HttpUri('http://localhost:1234/phpOMS/tests/Message/Http/HttpRequestLanguage.php')); + $request = new HttpRequest(new HttpUri('http://localhost:1234' . $GLOBALS['frameworkpath'] . 'tests/Message/Http/HttpRequestLanguage.php')); $request->setMethod(RequestMethod::GET); self::assertEquals( @@ -456,7 +456,7 @@ class HttpRequestTest extends \PHPUnit\Framework\TestCase */ public function testLocale() : void { - $request = new HttpRequest(new HttpUri('http://localhost:1234/phpOMS/tests/Message/Http/HttpRequestLocale.php')); + $request = new HttpRequest(new HttpUri('http://localhost:1234' . $GLOBALS['frameworkpath'] . 'tests/Message/Http/HttpRequestLocale.php')); $request->setMethod(RequestMethod::GET); self::assertEquals( @@ -472,7 +472,7 @@ class HttpRequestTest extends \PHPUnit\Framework\TestCase */ public function testMobile() : void { - $request = new HttpRequest(new HttpUri('http://localhost:1234/phpOMS/tests/Message/Http/HttpRequestMobile.php')); + $request = new HttpRequest(new HttpUri('http://localhost:1234' . $GLOBALS['frameworkpath'] . 'tests/Message/Http/HttpRequestMobile.php')); $request->setMethod(RequestMethod::GET); self::assertEquals( @@ -488,7 +488,7 @@ class HttpRequestTest extends \PHPUnit\Framework\TestCase */ public function testOS() : void { - $request = new HttpRequest(new HttpUri('http://localhost:1234/phpOMS/tests/Message/Http/HttpRequestOS.php')); + $request = new HttpRequest(new HttpUri('http://localhost:1234' . $GLOBALS['frameworkpath'] . 'tests/Message/Http/HttpRequestOS.php')); $request->setMethod(RequestMethod::GET); self::assertEquals( @@ -504,7 +504,7 @@ class HttpRequestTest extends \PHPUnit\Framework\TestCase */ public function testBrowser() : void { - $request = new HttpRequest(new HttpUri('http://localhost:1234/phpOMS/tests/Message/Http/HttpRequestBrowser.php')); + $request = new HttpRequest(new HttpUri('http://localhost:1234' . $GLOBALS['frameworkpath'] . 'tests/Message/Http/HttpRequestBrowser.php')); $request->setMethod(RequestMethod::GET); self::assertEquals( diff --git a/tests/Utils/Parser/Markdown/MarkdownTest.php b/tests/Utils/Parser/Markdown/MarkdownTest.php index 545e0a2bb..715165e7b 100644 --- a/tests/Utils/Parser/Markdown/MarkdownTest.php +++ b/tests/Utils/Parser/Markdown/MarkdownTest.php @@ -32,7 +32,7 @@ class MarkdownTest extends \PHPUnit\Framework\TestCase if ($data[1] === 'md' && (\file_get_contents(__DIR__ . '/data/' . $data[0] . '.html') !== Markdown::parse(\file_get_contents(__DIR__ . '/data/' . $data[0] . '.md'))) ) { - self::asserTrue(false, $file); + self::assertTrue(false, $file); } } diff --git a/tests/Utils/Parser/Markdown/data/xss_bad_url.html b/tests/Utils/Parser/Markdown/data/xss_bad_url.html index d62d25972..888232f17 100644 --- a/tests/Utils/Parser/Markdown/data/xss_bad_url.html +++ b/tests/Utils/Parser/Markdown/data/xss_bad_url.html @@ -9,8 +9,6 @@

xss

xss

xss

-

xss

xss

xss

-

xss

-

xss

\ No newline at end of file +

xss

\ No newline at end of file diff --git a/tests/Utils/Parser/Markdown/data/xss_bad_url.md b/tests/Utils/Parser/Markdown/data/xss_bad_url.md index a730952fb..7786b4263 100644 --- a/tests/Utils/Parser/Markdown/data/xss_bad_url.md +++ b/tests/Utils/Parser/Markdown/data/xss_bad_url.md @@ -20,12 +20,8 @@ [xss](data://text/html;base64,PHNjcmlwdD5hbGVydCgxKTwvc2NyaXB0Pg==) -[xss](data:text/html;base64,PHNjcmlwdD5hbGVydCgxKTwvc2NyaXB0Pg==) - ![xss](data:text/html;base64,PHNjcmlwdD5hbGVydCgxKTwvc2NyaXB0Pg==) ![xss]( data:text/html;base64,PHNjcmlwdD5hbGVydCgxKTwvc2NyaXB0Pg==) -![xss](data://text/html;base64,PHNjcmlwdD5hbGVydCgxKTwvc2NyaXB0Pg==) - -![xss](data:text/html;base64,PHNjcmlwdD5hbGVydCgxKTwvc2NyaXB0Pg==) \ No newline at end of file +![xss](data://text/html;base64,PHNjcmlwdD5hbGVydCgxKTwvc2NyaXB0Pg==) \ No newline at end of file diff --git a/tests/phpunit_no_coverage.xml b/tests/phpunit_no_coverage.xml index f073716d6..b442efcb8 100644 --- a/tests/phpunit_no_coverage.xml +++ b/tests/phpunit_no_coverage.xml @@ -37,6 +37,6 @@ - +