Added unit test for boolean option values.
It fail now. In `XmlDriver::_parseOptions` we need somehow to maintain a list of options, that are supposed to be boolean, and then call `$this->evaluateBoolean()` on them.
This commit is contained in:
parent
05e77868ab
commit
cdf4af5f27
@ -34,7 +34,7 @@ class XmlMappingDriverTest extends AbstractMappingDriverTest
|
||||
}
|
||||
|
||||
/**
|
||||
* @expectedException Doctrine\ORM\Cache\CacheException
|
||||
* @expectedException \Doctrine\ORM\Cache\CacheException
|
||||
* @expectedExceptionMessage Entity association field "Doctrine\Tests\ORM\Mapping\XMLSLC#foo" not configured as part of the second-level cache.
|
||||
*/
|
||||
public function testFailingSecondLevelCacheAssociation()
|
||||
@ -132,7 +132,7 @@ class XmlMappingDriverTest extends AbstractMappingDriverTest
|
||||
/**
|
||||
* @group DDC-1468
|
||||
*
|
||||
* @expectedException Doctrine\Common\Persistence\Mapping\MappingException
|
||||
* @expectedException \Doctrine\Common\Persistence\Mapping\MappingException
|
||||
* @expectedExceptionMessage Invalid mapping file 'Doctrine.Tests.Models.Generic.SerializationModel.dcm.xml' for class 'Doctrine\Tests\Models\Generic\SerializationModel'.
|
||||
*/
|
||||
public function testInvalidMappingFileException()
|
||||
@ -140,6 +140,13 @@ class XmlMappingDriverTest extends AbstractMappingDriverTest
|
||||
$this->createClassMetadata('Doctrine\Tests\Models\Generic\SerializationModel');
|
||||
}
|
||||
|
||||
public function testBooleanValuesForOptionIsSetCorrectly()
|
||||
{
|
||||
$class = $this->createClassMetadata('Doctrine\Tests\ORM\Mapping\User');
|
||||
$this->assertInternalType('bool', $class->fieldMappings['name']['options']['bool_opt']);
|
||||
$this->assertFalse($class->fieldMappings['name']['options']['bool_opt']);
|
||||
}
|
||||
|
||||
/**
|
||||
* @param string $xmlMappingFile
|
||||
* @dataProvider dataValidSchema
|
||||
|
@ -50,6 +50,7 @@
|
||||
<option name="baz">
|
||||
<option name="key">val</option>
|
||||
</option>
|
||||
<option name="bool_opt">false</option>
|
||||
</options>
|
||||
</field>
|
||||
<field name="email" column="user_email" type="string" column-definition="CHAR(32) NOT NULL" />
|
||||
|
Loading…
x
Reference in New Issue
Block a user