Skip to content

Commit

Permalink
Added test that passes following previous commit
Browse files Browse the repository at this point in the history
  • Loading branch information
garoevans authored and Ocramius committed Dec 8, 2014
1 parent fae0f6a commit 5670912
Show file tree
Hide file tree
Showing 2 changed files with 40 additions and 0 deletions.
23 changes: 23 additions & 0 deletions tests/Doctrine/Tests/Models/NullDefault/NullDefaultColumn.php
Original file line number Diff line number Diff line change
@@ -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;
}
17 changes: 17 additions & 0 deletions tests/Doctrine/Tests/ORM/Tools/SchemaToolTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -101,6 +101,23 @@ public function testPostGenerateEvents()
$this->assertEquals(count($classes), $listener->tableCalls);
$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);
}
}

/**
Expand Down

0 comments on commit 5670912

Please sign in to comment.