-
-
Notifications
You must be signed in to change notification settings - Fork 384
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Fix class constants as type in sql queries output
- Loading branch information
1 parent
6eff53d
commit dcbc151
Showing
4 changed files
with
113 additions
and
17 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
35 changes: 35 additions & 0 deletions
35
tests/Doctrine/DBAL/Migrations/Tests/Stub/VersionOutputSqlWithParamAndType.php
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,35 @@ | ||
<?php | ||
|
||
namespace Doctrine\DBAL\Migrations\Tests\Stub; | ||
|
||
use Doctrine\DBAL\Connection; | ||
use \Doctrine\DBAL\Migrations\AbstractMigration; | ||
use Doctrine\DBAL\Schema\Schema; | ||
|
||
class VersionOutputSqlWithParamAndType extends AbstractMigration | ||
{ | ||
private $param = [ | ||
'param1' => 1, | ||
]; | ||
|
||
private $type = [Connection::PARAM_STR_ARRAY]; | ||
|
||
public function setParam($param) | ||
{ | ||
$this->param = $param; | ||
} | ||
|
||
public function setType(array $type) | ||
{ | ||
$this->type = $type; | ||
} | ||
|
||
public function down(Schema $schema) | ||
{ | ||
} | ||
|
||
public function up(Schema $schema) | ||
{ | ||
$this->addSql('Select id WHERE id IN ( :param1 )', $this->param, $this->type); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters