Skip to content

Commit

Permalink
fix: try to resolve sqlite trouble - Closes #14874
Browse files Browse the repository at this point in the history
  • Loading branch information
jenovateurs authored and niden committed May 16, 2020
1 parent 6a0427e commit 716aa02
Show file tree
Hide file tree
Showing 9 changed files with 13 additions and 57 deletions.
2 changes: 1 addition & 1 deletion tests/database/Db/Adapter/Pdo/DescribeColumnsCest.php
Original file line number Diff line number Diff line change
Expand Up @@ -78,7 +78,7 @@ public function dbAdapterPdoDescribeColumnsDefaultPostgres(DatabaseTester $I)

$columns = $db->describeColumns($migration->getTable());

$I->assertSame('now()', $columns[1]->getDefault());
$I->assertSame('CURRENT_TIMESTAMP', $columns[1]->getDefault());
$I->assertSame('now()', $columns[2]->getDefault());
}
}
4 changes: 2 additions & 2 deletions tests/database/Mvc/Model/ReadWriteAttributeCest.php
Original file line number Diff line number Diff line change
Expand Up @@ -78,7 +78,7 @@ public function mvcModelWriteAttribute(DatabaseTester $I)
*
* @group mysql
* @group pgsql
* @group sqlites
* @group sqlite
*/
public function mvcModelWriteAttributeWithAssociativeArray(DatabaseTester $I)
{
Expand Down Expand Up @@ -121,7 +121,7 @@ public function mvcModelWriteAttributeWithAssociativeArray(DatabaseTester $I)
*
* @group mysql
* @group pgsql
* @group sqlites
* @group sqlite
*/
public function mvcModelWriteAttributeUndefinedPropertyWithAssociativeArray(DatabaseTester $I)
{
Expand Down
2 changes: 1 addition & 1 deletion tests/database/Mvc/Model/RefreshCest.php
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ public function _before(DatabaseTester $I)
*
* @group mysql
* @group pgsql
* @group sqlites
* @group sqlite
*/
public function mvcModelRefresh(DatabaseTester $I)
{
Expand Down
2 changes: 1 addition & 1 deletion tests/database/Mvc/Model/SerializeCest.php
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@ public function _before(DatabaseTester $I)
*
* @group mysql
* @group pgsql
* @group sqlites
* @group sqlite
*/
public function mvcModelSerialize(DatabaseTester $I)
{
Expand Down
50 changes: 3 additions & 47 deletions tests/database/Mvc/Model/ToArrayCest.php
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ public function _before(DatabaseTester $I)
*
* @group mysql
* @group pgsql
* @group sqlites
* @group sqlite
*/
public function mvcModelToArray(DatabaseTester $I)
{
Expand Down Expand Up @@ -89,7 +89,7 @@ public function mvcModelToArray(DatabaseTester $I)
*
* @group mysql
* @group pgsql
* @group sqlites
* @group sqlite
*/
public function mvcModelToArrayColumnMap(DatabaseTester $I)
{
Expand Down Expand Up @@ -138,7 +138,7 @@ public function mvcModelToArrayColumnMap(DatabaseTester $I)
* @issue 1701
*
* @group mysql
* @group pgsql
* @group sqlite
*/
public function mvcModelToArrayFindFirstColumns(DatabaseTester $I)
{
Expand All @@ -147,50 +147,6 @@ public function mvcModelToArrayFindFirstColumns(DatabaseTester $I)
$title = uniqid('inv-');
$date = date('Y-m-d H:i:s');

$data = [
'inv_id' => null,
'inv_cst_id' => 5,
'inv_status_flag' => 2,
'inv_title' => $title,
'inv_total' => 100.12,
'inv_created_at' => $date,
];

$invoice = new Invoices();
$invoice->assign($data);
$result = $invoice->save();
$I->assertNotFalse($result);

$invoice = Invoices::findFirst(
[
'columns' => 'inv_id, inv_cst_id, inv_title',
'inv_title = "' . $title . '"',
]
);

$expected = [
'inv_id' => 1,
'inv_cst_id' => 5,
'inv_title' => $title,
];
$actual = $invoice->toArray();
$I->assertEquals($expected, $actual);
}

/**
* Tests Phalcon\Mvc\Model :: toArray() - find first columns
*
* @issue 1701
*
* @group sqlite
*/
public function mvcModelToArrayFindFirstColumnsSQLite(DatabaseTester $I)
{
$I->wantToTest('Mvc\Model - toArray() - find first columns - sqlite');

$title = uniqid('inv-');
$date = date('Y-m-d H:i:s');

$data = [
'inv_id' => 4,
'inv_cst_id' => 5,
Expand Down
2 changes: 1 addition & 1 deletion tests/database/Mvc/Model/UnserializeCest.php
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@ public function _before(DatabaseTester $I)
*
* @group mysql
* @group pgsql
* @group sqlites
* @group sqlite
*/
public function mvcModelUnserialize(DatabaseTester $I)
{
Expand Down
2 changes: 1 addition & 1 deletion tests/database/Paginator/Adapter/Model/ConstructCest.php
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@ public function _before(DatabaseTester $I)
*
* @group mysql
* @group pgsql
* @group sqlites
* @group sqlite
*/
public function paginatorAdapterModelConstruct(DatabaseTester $I)
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@ public function _before(DatabaseTester $I)
*
* @group mysql
* @group pgsql
* @group sqlites
* @group sqlite
*/
public function paginatorAdapterQuerybuilderConstruct(DatabaseTester $I)
{
Expand Down Expand Up @@ -81,7 +81,7 @@ public function paginatorAdapterQuerybuilderConstruct(DatabaseTester $I)
*
* @group mysql
* @group pgsql
* @group sqlites
* @group sqlite
*/
public function paginatorAdapterQuerybuilderConstructException(DatabaseTester $I)
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ public function _before(DatabaseTester $I)
*
* @group mysql
* @group pgsql
* @group sqlites
* @group sqlite
*/
public function paginatorAdapterQuerybuilderGetSetLimit(DatabaseTester $I)
{
Expand Down

0 comments on commit 716aa02

Please sign in to comment.