Added test that passes following previous commit
This commit is contained in:
parent
fae0f6a29a
commit
5670912d0d
@ -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;
|
||||||
|
}
|
@ -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);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
Loading…
x
Reference in New Issue
Block a user