1
0
mirror of synced 2025-02-02 13:31:45 +03:00

Added test that passes following previous commit

This commit is contained in:
Gareth Evans 2014-12-03 19:37:53 +00:00 committed by Marco Pivetta
parent fae0f6a29a
commit 5670912d0d
2 changed files with 40 additions and 0 deletions

View File

@ -0,0 +1,23 @@
<?php
namespace Doctrine\Tests\Models\NullDefault;
/**
* @Entity
* @Table(name="null-default")
*/
class NullDefaultColumn
{
/**
* @Id
* @GeneratedValue
* @Column(type="integer")
*/
public $id;
/**
* @Column(name="`null-default`",nullable=true,options={"default":NULL})
*/
public $nullDefault;
}

View File

@ -101,6 +101,23 @@ class SchemaToolTest extends \Doctrine\Tests\OrmTestCase
$this->assertEquals(count($classes), $listener->tableCalls); $this->assertEquals(count($classes), $listener->tableCalls);
$this->assertTrue($listener->schemaCalled); $this->assertTrue($listener->schemaCalled);
} }
public function testNullDefaultNotAddedToCustomSchemaOptions()
{
$em = $this->_getTestEntityManager();
$schemaTool = new SchemaTool($em);
$classes = array(
$em->getClassMetadata('Doctrine\Tests\Models\NullDefault\NullDefaultColumn'),
);
$customSchemaOptions = $schemaTool->getSchemaFromMetadata($classes)
->getTable('null-default')
->getColumn('null-default')
->getCustomSchemaOptions();
$this->assertSame(array(), $customSchemaOptions);
}
} }
/** /**