Skip to content

Commit 5969d92

Browse files
committed
Fail test
1 parent ba1ee9c commit 5969d92

4 files changed

Lines changed: 56 additions & 15 deletions

File tree

phpunit.xml

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,8 +7,7 @@
77
convertNoticesToExceptions="true"
88
convertWarningsToExceptions="true"
99
processIsolation="false"
10-
stopOnFailure="false"
11-
>
10+
stopOnFailure="true">
1211
<testsuites>
1312
<testsuite name="unit">
1413
<directory>./tests/unit</directory>

src/Database/Adapter/SQL.php

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3148,11 +3148,13 @@ public function find(Document $collection, array $queries = [], ?int $limit = 25
31483148
";
31493149

31503150
$sql = $this->trigger(Database::EVENT_DOCUMENT_FIND, $sql);
3151-
3151+
var_dump($sql);
31523152
try {
31533153
$stmt = $this->getPDO()->prepare($sql);
31543154

31553155
foreach ($binds as $key => $value) {
3156+
var_dump($key);
3157+
var_dump($value);
31563158
if (gettype($value) === 'double') {
31573159
$stmt->bindValue($key, $this->getFloatPrecision($value), \PDO::PARAM_STR);
31583160
} else {

tests/e2e/Adapter/Base.php

Lines changed: 12 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -23,19 +23,19 @@
2323

2424
abstract class Base extends TestCase
2525
{
26-
use CollectionTests;
27-
use CustomDocumentTypeTests;
26+
// use CollectionTests;
27+
// use CustomDocumentTypeTests;
2828
use DocumentTests;
29-
use AttributeTests;
30-
use IndexTests;
31-
use OperatorTests;
32-
use PermissionTests;
33-
use RelationshipTests;
34-
use SpatialTests;
35-
use SchemalessTests;
36-
use ObjectAttributeTests;
37-
use VectorTests;
38-
use GeneralTests;
29+
// use AttributeTests;
30+
// use IndexTests;
31+
// use OperatorTests;
32+
// use PermissionTests;
33+
// use RelationshipTests;
34+
// use SpatialTests;
35+
// use SchemalessTests;
36+
// use ObjectAttributeTests;
37+
// use VectorTests;
38+
// use GeneralTests;
3939

4040
protected static string $namespace;
4141

tests/e2e/Adapter/Scopes/DocumentTests.php

Lines changed: 40 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2177,6 +2177,46 @@ public function testFindFulltextSpecialChars(): void
21772177
]);
21782178

21792179
$this->assertEquals(1, count($documents));
2180+
2181+
$phrases = [
2182+
'+', // lone plus operator
2183+
'-', // lone minus operator
2184+
'~', // lone negation
2185+
'*', // wildcard alone
2186+
'"', // just a quote
2187+
'(', // opening paren
2188+
')', // closing paren
2189+
'+(', // plus + unmatched paren
2190+
'-(', // minus + unmatched paren
2191+
'("', // unmatched paren + quote
2192+
'+("', // combination of +, paren, quote
2193+
')+', // closing paren + operator
2194+
'""', // double quote alone
2195+
'(((', // multiple unmatched parens
2196+
')))', // multiple unmatched closing parens
2197+
'+~', // plus + negation
2198+
'--', // double minus
2199+
'~~', // double negation
2200+
'+*', // plus + wildcard
2201+
'-*', // minus + wildcard
2202+
'+"test', // plus + unmatched quote
2203+
'"test', // unmatched quote
2204+
'"test\0', // unmatched quote + null byte
2205+
'+("test\0', // combination + unmatched quote + null byte
2206+
"\0", // null byte alone
2207+
"\x01", // control char 1
2208+
"\x02", // control char 2
2209+
"\x1f", // control char 31
2210+
];
2211+
foreach ($phrases as $phrase) {
2212+
$documents = $database->find($collection, [
2213+
Query::search('ft', $phrase),
2214+
]);
2215+
}
2216+
2217+
$this->assertEquals(12, 222);
2218+
2219+
var_dump($documents);
21802220
}
21812221

21822222
public function testFindMultipleConditions(): void

0 commit comments

Comments
 (0)