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