Version 3 #1

Manually merged
timw4mail merged 47 commits from develop into master 2020-04-23 18:39:27 -04:00
Showing only changes of commit 2821a2d4e1 - Show all commits

View File

@ -47,51 +47,12 @@ use Query\Tests\BaseQueryBuilderTest;
->get('create_test', 2, 1); ->get('create_test', 2, 1);
$res = $query->fetchAll(PDO::FETCH_ASSOC); $res = $query->fetchAll(PDO::FETCH_ASSOC);
$actualDetail = $res[0]['detail'];
$this->assertTrue(is_string($actualDetail));
$expectedPossibilities = []; $expectedPossibilities = [
'TABLE create_test USING PRIMARY KEY',
$expectedPossibilities[] = [ 'SEARCH TABLE create_test USING INTEGER PRIMARY KEY (rowid>? AND rowid<?)',
[
'order' => '0',
'from' => '0',
'detail' => 'TABLE create_test USING PRIMARY KEY',
]
];
$expectedPossibilities[] = [
[
'selectid' => '0',
'order' => '0',
'from' => '0',
'detail' => 'SEARCH TABLE create_test USING INTEGER PRIMARY KEY (rowid>? AND rowid<?) (~60000 rows)',
],
];
$expectedPossibilities[] = [
[
'selectid' => '0',
'order' => '0',
'from' => '0',
'detail' => 'SEARCH TABLE create_test USING INTEGER PRIMARY KEY (rowid>? AND rowid<?)',
],
];
$expectedPossibilities[] = [
[
'selectid' => '0',
'order' => '0',
'from' => '0',
'detail' => 'SEARCH TABLE create_test USING INTEGER PRIMARY KEY (rowid>? AND rowid<?) (~62500 rows)',
],
];
$expectedPossibilities[] = [
[
'id' => '6',
'parent' => '0',
'notused' => '0',
'detail' => 'SEARCH TABLE create_test USING INTEGER PRIMARY KEY (rowid>? AND rowid<?)',
],
]; ];
$passed = FALSE; $passed = FALSE;
@ -99,9 +60,8 @@ use Query\Tests\BaseQueryBuilderTest;
// Check for a matching possibility // Check for a matching possibility
foreach($expectedPossibilities as $ep) foreach($expectedPossibilities as $ep)
{ {
if ($res === $ep) if (stripos($actualDetail, $ep) !== FALSE)
{ {
$this->assertTrue(TRUE);
$passed = TRUE; $passed = TRUE;
} }
} }
@ -110,8 +70,9 @@ use Query\Tests\BaseQueryBuilderTest;
if ( ! $passed) if ( ! $passed)
{ {
var_export($res); var_export($res);
$this->assertTrue(FALSE);
} }
$this->assertTrue($passed);
} }
public function testInsertReturning(): void public function testInsertReturning(): void