-
-
Notifications
You must be signed in to change notification settings - Fork 1.3k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[DBAL-1779] Fix string column type declarations with whitespace on SQLite #2272
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -3,6 +3,7 @@ | |
namespace Doctrine\Tests\DBAL\Functional\Schema; | ||
|
||
use Doctrine\DBAL\Schema; | ||
use Doctrine\DBAL\Types\Type; | ||
|
||
class SqliteSchemaManagerTest extends SchemaManagerFunctionalTestCase | ||
{ | ||
|
@@ -156,6 +157,34 @@ public function testNonDefaultPKOrder() | |
$this->assertEquals(array('other_id', 'id'), array_map('strtolower', $tableIndexes['primary']->getColumns())); | ||
} | ||
|
||
/** | ||
* @group DBAL-1779 | ||
*/ | ||
public function testListTableColumnsWithWhitespacesInTypeDeclarations() | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Probably needs also a testListTableColumnsWithoutWhitespacesInTypeDeclarations, too. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. @zeroedin-bill this is already covered by all the other DBAL tests There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. k |
||
{ | ||
$sql = <<<SQL | ||
CREATE TABLE dbal_1779 ( | ||
foo VARCHAR (64) , | ||
bar TEXT (100) | ||
) | ||
SQL; | ||
|
||
$this->_conn->executeQuery($sql); | ||
|
||
$columns = $this->_sm->listTableColumns('dbal_1779'); | ||
|
||
$this->assertCount(2, $columns); | ||
|
||
$this->assertArrayHasKey('foo', $columns); | ||
$this->assertArrayHasKey('bar', $columns); | ||
|
||
$this->assertSame(Type::getType(Type::STRING), $columns['foo']->getType()); | ||
$this->assertSame(Type::getType(Type::TEXT), $columns['bar']->getType()); | ||
|
||
$this->assertSame(64, $columns['foo']->getLength()); | ||
$this->assertSame(100, $columns['bar']->getLength()); | ||
} | ||
|
||
/** | ||
* @dataProvider getDiffListIntegerAutoincrementTableColumnsData | ||
* @group DBAL-924 | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
👍