Skip to content

Commit e75a3f2

Browse files
committed
backport some test expectations to have a working build of jackalope-doctrine-dbal again
1 parent 431c29b commit e75a3f2

File tree

2 files changed

+8
-4
lines changed

2 files changed

+8
-4
lines changed

tests/06_Query/QOM/ConvertQueriesBackAndForthTest.php

+2-1
Original file line numberDiff line numberDiff line change
@@ -53,6 +53,7 @@ public function testBackAndForth()
5353
foreach ($this->qomQueries as $name => $originalQomQuery) {
5454
$originalSql2Query = $this->sql2Queries[$name];
5555
if (is_array($originalSql2Query)) {
56+
$this->assertGreaterThan(0, count($originalSql2Query), 'empty list of queries');
5657
$passed = false;
5758
foreach ($originalSql2Query as $query) {
5859
$qom = $this->sql2Parser->parse($query);
@@ -64,7 +65,7 @@ public function testBackAndForth()
6465
}
6566
}
6667
}
67-
$this->assertTrue($passed, "QOM-->SQL2->QOM: Original query variation = ".$query);
68+
$this->assertTrue($passed, "QOM-->SQL2->QOM: Query variation $name resulted in SQL2 that is not found: $sql2");
6869
} else {
6970
$qom = $this->sql2Parser->parse($originalSql2Query);
7071
$this->assertEquals($originalQomQuery, $qom, "QOM-->SQL2: Original query = $originalSql2Query");

tests/06_Query/QOM/Sql2TestQueries.php

+6-3
Original file line numberDiff line numberDiff line change
@@ -59,7 +59,7 @@ public static function getQueries()
5959

6060
$queries['6.7.12.Constraint.Precedence.3'] = array(
6161
'SELECT * FROM [nt:file] AS file WHERE NOT file.prop1 = \'1\' OR file.prop2 = \'2\' AND NOT file.prop3 = \'3\'',
62-
'SELECT * FROM [nt:file] AS file WHERE (NOT file.prop1 = \'1\' OR (file.prop2 = \'2\' AND NOT file.prop3 = \'3\'))',
62+
'SELECT * FROM [nt:file] AS file WHERE ((NOT file.prop1 = \'1\') OR (file.prop2 = \'2\' AND (NOT file.prop3 = \'3\')))',
6363
);
6464

6565
$queries['6.7.12.Constraint.Precedence.4'] = array(
@@ -76,8 +76,8 @@ public static function getQueries()
7676
'SELECT * FROM [nt:file] AS file WHERE
7777
NOT file.prop1 IS NOT NULL AND NOT NOT file.prop2 IS NOT NULL
7878
OR NOT file.prop3 = \'hello\' AND file.prop4 <> \'hello\'',
79-
8079
'SELECT * FROM [nt:file] AS file WHERE ((NOT file.prop1 IS NOT NULL AND NOT NOT file.prop2 IS NOT NULL) OR (NOT file.prop3 = \'hello\' AND file.prop4 <> \'hello\'))',
80+
'SELECT * FROM [nt:file] AS file WHERE (((NOT file.prop1 IS NOT NULL) AND (NOT (NOT file.prop2 IS NOT NULL))) OR ((NOT file.prop3 = \'hello\') AND file.prop4 <> \'hello\'))',
8181
);
8282

8383
/**
@@ -99,7 +99,10 @@ public static function getQueries()
9999
/**
100100
* 6.7.15. NotConstraint
101101
*/
102-
$queries['6.7.15.Not'] = 'SELECT * FROM [nt:file] AS file WHERE NOT file.prop1 IS NOT NULL';
102+
$queries['6.7.15.Not'] = array(
103+
'SELECT * FROM [nt:file] AS file WHERE NOT file.prop1 IS NOT NULL',
104+
'SELECT * FROM [nt:file] AS file WHERE (NOT file.prop1 IS NOT NULL)',
105+
);
103106

104107
/**
105108
* 6.7.16. Comparison

0 commit comments

Comments
 (0)