Vendor update && Started using DoctrineMigrations

This commit is contained in:
Polonkai Gergely
2012-07-23 17:09:03 +02:00
parent 7c36f93436
commit bf46316347
1102 changed files with 103189 additions and 7 deletions

View File

@@ -0,0 +1,36 @@
<?php
namespace Metadata\Tests;
use Metadata\Tests\Fixtures\TestObject;
use Metadata\PropertyMetadata;
class PropertyMetadataTest extends \PHPUnit_Framework_TestCase
{
public function testConstructor()
{
$metadata = new PropertyMetadata('Metadata\Tests\Fixtures\TestObject', 'foo');
$this->assertEquals('Metadata\Tests\Fixtures\TestObject', $metadata->class);
$this->assertEquals('foo', $metadata->name);
$this->assertEquals(new \ReflectionProperty('Metadata\Tests\Fixtures\TestObject', 'foo'), $metadata->reflection);
}
public function testSerializeUnserialize()
{
$metadata = new PropertyMetadata('Metadata\Tests\Fixtures\TestObject', 'foo');
$this->assertEquals($metadata, unserialize(serialize($metadata)));
}
public function testSetGetValue()
{
$obj = new TestObject();
$metadata = new PropertyMetadata('Metadata\Tests\Fixtures\TestObject', 'foo');
$this->assertNull($metadata->getValue($obj));
$metadata->setValue($obj, 'foo');
$this->assertEquals('foo', $metadata->getValue($obj));
}
}