Skip to content
Permalink
Browse files

[#14080] - Fixed array to string conversion for delete

  • Loading branch information...
niden committed Jul 5, 2019
1 parent 35163a4 commit 467ec6bc2cb587ca75dc73ee58f44003637ab275
@@ -263,7 +263,7 @@ abstract class AbstractAdapter implements AdapterInterface, EventsAwareInterface
* DELETE FROM `robots` WHERE `id` = 101
* ```
*/
public function delete(string table, var whereCondition = null, var placeholders = null, var dataTypes = null) -> bool
public function delete(var table, var whereCondition = null, var placeholders = null, var dataTypes = null) -> bool
{
var sql, escapedTable;

@@ -86,7 +86,7 @@ interface AdapterInterface
/**
* Deletes data from a table using custom RDBMS SQL syntax
*/
public function delete(string table, whereCondition = null, placeholders = null, dataTypes = null) -> bool;
public function delete(var table, whereCondition = null, placeholders = null, dataTypes = null) -> bool;

/**
* Returns an array of Phalcon\Db\Column objects describing a table
@@ -13,12 +13,17 @@
namespace Phalcon\Test\Integration\Mvc\Model;
use IntegrationTester;
use Phalcon\Test\Fixtures\Traits\DiTrait;
use Phalcon\Test\Models\AlbumORama\Artists;
use function uniqid;
/**
* Class CreateCest
*/
class CreateCest
{
use DiTrait;
/**
* Tests Phalcon\Mvc\Model :: create()
*
@@ -28,6 +33,35 @@ class CreateCest
public function mvcModelCreate(IntegrationTester $I)
{
$I->wantToTest('Mvc\Model - create()');
$I->skipTest('Need implementation');
$this->setNewFactoryDefault();
$name = uniqid();
// MySql
$this->setDiMysql();
$artist = new Artists();
$artist->name = $name;
$result = $artist->save();
$I->assertNotFalse($result);
$result = $artist->delete();
$I->assertNotFalse($result);
// Postgresql
$this->setDiPostgresql();
$artist = new Artists();
$artist->name = $name;
$result = $artist->save();
$I->assertNotFalse($result);
$result = $artist->delete();
$I->assertNotFalse($result);
}
}
@@ -13,12 +13,17 @@
namespace Phalcon\Test\Integration\Mvc\Model;
use IntegrationTester;
use Phalcon\Test\Fixtures\Traits\DiTrait;
use Phalcon\Test\Models\AlbumORama\Artists;
use function uniqid;
/**
* Class DeleteCest
*/
class DeleteCest
{
use DiTrait;
/**
* Tests Phalcon\Mvc\Model :: delete()
*
@@ -28,6 +33,35 @@ class DeleteCest
public function mvcModelDelete(IntegrationTester $I)
{
$I->wantToTest('Mvc\Model - delete()');
$I->skipTest('Need implementation');
$this->setNewFactoryDefault();
$name = uniqid();
// MySql
$this->setDiMysql();
$artist = new Artists();
$artist->name = $name;
$result = $artist->save();
$I->assertNotFalse($result);
$result = $artist->delete();
$I->assertNotFalse($result);
// Postgresql
$this->setDiPostgresql();
$artist = new Artists();
$artist->name = $name;
$result = $artist->save();
$I->assertNotFalse($result);
$result = $artist->delete();
$I->assertNotFalse($result);
}
}

0 comments on commit 467ec6b

Please sign in to comment.
You can’t perform that action at this time.