Do you wish to register an account?
Преглед изворни кода

Make sqlite-specific test more robust

tags/v3.0.0^2
Timothy Warren пре 2 месеци
родитељ
комит
2821a2d4e1
1 измењених фајлова са 8 додато и 47 уклоњено
  1. +8
    -47
      tests/Drivers/SQLite/SQLiteQueryBuilderTest.php

+ 8
- 47
tests/Drivers/SQLite/SQLiteQueryBuilderTest.php Прегледај датотеку

@@ -47,51 +47,12 @@ use Query\Tests\BaseQueryBuilderTest;
->get('create_test', 2, 1);

$res = $query->fetchAll(PDO::FETCH_ASSOC);
$actualDetail = $res[0]['detail'];
$this->assertTrue(is_string($actualDetail));

$expectedPossibilities = [];

$expectedPossibilities[] = [
[
'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<?)',
],
$expectedPossibilities = [
'TABLE create_test USING PRIMARY KEY',
'SEARCH TABLE create_test USING INTEGER PRIMARY KEY (rowid>? AND rowid<?)',
];

$passed = FALSE;
@@ -99,9 +60,8 @@ use Query\Tests\BaseQueryBuilderTest;
// Check for a matching possibility
foreach($expectedPossibilities as $ep)
{
if ($res === $ep)
if (stripos($actualDetail, $ep) !== FALSE)
{
$this->assertTrue(TRUE);
$passed = TRUE;
}
}
@@ -110,8 +70,9 @@ use Query\Tests\BaseQueryBuilderTest;
if ( ! $passed)
{
var_export($res);
$this->assertTrue(FALSE);
}

$this->assertTrue($passed);
}

public function testInsertReturning(): void


Loading…
Откажи
Сачувај