From f0c8ae5e2daefb5d76e6d9c62e30ba36dae5e76f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Thomas=20K=C3=B6rner?= Date: Mon, 18 Mar 2024 11:57:59 +0100 Subject: [PATCH] adjust test, fix typo --- src/Util/DatabaseUtil/CreateWhereForSerializedBlobResult.php | 2 +- tests/Util/DatabaseUtil/DatabaseUtilTest.php | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/src/Util/DatabaseUtil/CreateWhereForSerializedBlobResult.php b/src/Util/DatabaseUtil/CreateWhereForSerializedBlobResult.php index 9f2b3f85..dada3e99 100644 --- a/src/Util/DatabaseUtil/CreateWhereForSerializedBlobResult.php +++ b/src/Util/DatabaseUtil/CreateWhereForSerializedBlobResult.php @@ -23,7 +23,7 @@ public function createInlineAndWhere(): string */ public function createInlineOrWhere(): string { - return '('.$this->field.' REGEXP (\''.implode("\') OR ".$this->field.' REGEXP (\'', $this->getValueList()).'\'))'; + return '('.$this->field.' REGEXP (\''.implode('\') OR '.$this->field.' REGEXP (\'', $this->getValueList()).'\'))'; } /** diff --git a/tests/Util/DatabaseUtil/DatabaseUtilTest.php b/tests/Util/DatabaseUtil/DatabaseUtilTest.php index fbe9597b..f764e81e 100644 --- a/tests/Util/DatabaseUtil/DatabaseUtilTest.php +++ b/tests/Util/DatabaseUtil/DatabaseUtilTest.php @@ -20,8 +20,8 @@ public function testCreateWhereForSerializedBlob() static::assertInstanceOf(CreateWhereForSerializedBlobResult::class, $result); static::assertSame('(elements REGEXP (?) OR elements REGEXP (?))', $result->createOrWhere()); static::assertSame('(elements REGEXP (?) AND elements REGEXP (?))', $result->createAndWhere()); - static::assertSame('(elements REGEXP (:"texts") OR elements REGEXP (:"headline"))', $result->createInlineOrWhere()); - static::assertSame('(elements REGEXP (:"texts") AND elements REGEXP (:"headline"))', $result->createInlineAndWhere()); + static::assertSame('(elements REGEXP (\':"texts"\') OR elements REGEXP (\':"headline"\'))', $result->createInlineOrWhere()); + static::assertSame('(elements REGEXP (\':"texts"\') AND elements REGEXP (\':"headline"\'))', $result->createInlineAndWhere()); static::assertCount(2, $result->values); }