|
|
|
@ -209,7 +209,7 @@ class EntityTypeTest extends TypeTestCase
|
|
|
|
|
$field->setData(null);
|
|
|
|
|
|
|
|
|
|
$this->assertNull($field->getData());
|
|
|
|
|
$this->assertSame('', $field->getClientData());
|
|
|
|
|
$this->assertSame('', $field->getViewData());
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
public function testSetDataMultipleExpandedNull()
|
|
|
|
@ -223,7 +223,7 @@ class EntityTypeTest extends TypeTestCase
|
|
|
|
|
$field->setData(null);
|
|
|
|
|
|
|
|
|
|
$this->assertNull($field->getData());
|
|
|
|
|
$this->assertSame(array(), $field->getClientData());
|
|
|
|
|
$this->assertSame(array(), $field->getViewData());
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
public function testSetDataMultipleNonExpandedNull()
|
|
|
|
@ -237,7 +237,7 @@ class EntityTypeTest extends TypeTestCase
|
|
|
|
|
$field->setData(null);
|
|
|
|
|
|
|
|
|
|
$this->assertNull($field->getData());
|
|
|
|
|
$this->assertSame(array(), $field->getClientData());
|
|
|
|
|
$this->assertSame(array(), $field->getViewData());
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
public function testSubmitSingleExpandedNull()
|
|
|
|
@ -251,7 +251,7 @@ class EntityTypeTest extends TypeTestCase
|
|
|
|
|
$field->bind(null);
|
|
|
|
|
|
|
|
|
|
$this->assertNull($field->getData());
|
|
|
|
|
$this->assertSame(array(), $field->getClientData());
|
|
|
|
|
$this->assertSame(array(), $field->getViewData());
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
public function testSubmitSingleNonExpandedNull()
|
|
|
|
@ -265,7 +265,7 @@ class EntityTypeTest extends TypeTestCase
|
|
|
|
|
$field->bind(null);
|
|
|
|
|
|
|
|
|
|
$this->assertNull($field->getData());
|
|
|
|
|
$this->assertSame('', $field->getClientData());
|
|
|
|
|
$this->assertSame('', $field->getViewData());
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
public function testSubmitMultipleNull()
|
|
|
|
@ -278,7 +278,7 @@ class EntityTypeTest extends TypeTestCase
|
|
|
|
|
$field->bind(null);
|
|
|
|
|
|
|
|
|
|
$this->assertEquals(new ArrayCollection(), $field->getData());
|
|
|
|
|
$this->assertSame(array(), $field->getClientData());
|
|
|
|
|
$this->assertSame(array(), $field->getViewData());
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
public function testSubmitSingleNonExpandedSingleIdentifier()
|
|
|
|
@ -300,7 +300,7 @@ class EntityTypeTest extends TypeTestCase
|
|
|
|
|
|
|
|
|
|
$this->assertTrue($field->isSynchronized());
|
|
|
|
|
$this->assertSame($entity2, $field->getData());
|
|
|
|
|
$this->assertSame('2', $field->getClientData());
|
|
|
|
|
$this->assertSame('2', $field->getViewData());
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
public function testSubmitSingleNonExpandedCompositeIdentifier()
|
|
|
|
@ -323,7 +323,7 @@ class EntityTypeTest extends TypeTestCase
|
|
|
|
|
|
|
|
|
|
$this->assertTrue($field->isSynchronized());
|
|
|
|
|
$this->assertSame($entity2, $field->getData());
|
|
|
|
|
$this->assertSame('1', $field->getClientData());
|
|
|
|
|
$this->assertSame('1', $field->getViewData());
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
public function testSubmitMultipleNonExpandedSingleIdentifier()
|
|
|
|
@ -348,7 +348,7 @@ class EntityTypeTest extends TypeTestCase
|
|
|
|
|
|
|
|
|
|
$this->assertTrue($field->isSynchronized());
|
|
|
|
|
$this->assertEquals($expected, $field->getData());
|
|
|
|
|
$this->assertSame(array('1', '3'), $field->getClientData());
|
|
|
|
|
$this->assertSame(array('1', '3'), $field->getViewData());
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
public function testSubmitMultipleNonExpandedSingleIdentifierForExistingData()
|
|
|
|
@ -379,7 +379,7 @@ class EntityTypeTest extends TypeTestCase
|
|
|
|
|
$this->assertEquals($expected, $field->getData());
|
|
|
|
|
// same object still, useful if it is a PersistentCollection
|
|
|
|
|
$this->assertSame($existing, $field->getData());
|
|
|
|
|
$this->assertSame(array('1', '3'), $field->getClientData());
|
|
|
|
|
$this->assertSame(array('1', '3'), $field->getViewData());
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
public function testSubmitMultipleNonExpandedCompositeIdentifier()
|
|
|
|
@ -405,7 +405,7 @@ class EntityTypeTest extends TypeTestCase
|
|
|
|
|
|
|
|
|
|
$this->assertTrue($field->isSynchronized());
|
|
|
|
|
$this->assertEquals($expected, $field->getData());
|
|
|
|
|
$this->assertSame(array('0', '2'), $field->getClientData());
|
|
|
|
|
$this->assertSame(array('0', '2'), $field->getViewData());
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
public function testSubmitMultipleNonExpandedCompositeIdentifierExistingData()
|
|
|
|
@ -436,7 +436,7 @@ class EntityTypeTest extends TypeTestCase
|
|
|
|
|
$this->assertEquals($expected, $field->getData());
|
|
|
|
|
// same object still, useful if it is a PersistentCollection
|
|
|
|
|
$this->assertSame($existing, $field->getData());
|
|
|
|
|
$this->assertSame(array('0', '2'), $field->getClientData());
|
|
|
|
|
$this->assertSame(array('0', '2'), $field->getViewData());
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
public function testSubmitSingleExpanded()
|
|
|
|
@ -460,8 +460,8 @@ class EntityTypeTest extends TypeTestCase
|
|
|
|
|
$this->assertSame($entity2, $field->getData());
|
|
|
|
|
$this->assertFalse($field['1']->getData());
|
|
|
|
|
$this->assertTrue($field['2']->getData());
|
|
|
|
|
$this->assertNull($field['1']->getClientData());
|
|
|
|
|
$this->assertSame('2', $field['2']->getClientData());
|
|
|
|
|
$this->assertNull($field['1']->getViewData());
|
|
|
|
|
$this->assertSame('2', $field['2']->getViewData());
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
public function testSubmitMultipleExpanded()
|
|
|
|
@ -489,9 +489,9 @@ class EntityTypeTest extends TypeTestCase
|
|
|
|
|
$this->assertTrue($field['1']->getData());
|
|
|
|
|
$this->assertFalse($field['2']->getData());
|
|
|
|
|
$this->assertTrue($field['3']->getData());
|
|
|
|
|
$this->assertSame('1', $field['1']->getClientData());
|
|
|
|
|
$this->assertNull($field['2']->getClientData());
|
|
|
|
|
$this->assertSame('3', $field['3']->getClientData());
|
|
|
|
|
$this->assertSame('1', $field['1']->getViewData());
|
|
|
|
|
$this->assertNull($field['2']->getViewData());
|
|
|
|
|
$this->assertSame('3', $field['3']->getViewData());
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
public function testOverrideChoices()
|
|
|
|
@ -515,7 +515,7 @@ class EntityTypeTest extends TypeTestCase
|
|
|
|
|
$this->assertEquals(array(1 => new ChoiceView($entity1, '1', 'Foo'), 2 => new ChoiceView($entity2, '2', 'Bar')), $field->createView()->vars['choices']);
|
|
|
|
|
$this->assertTrue($field->isSynchronized());
|
|
|
|
|
$this->assertSame($entity2, $field->getData());
|
|
|
|
|
$this->assertSame('2', $field->getClientData());
|
|
|
|
|
$this->assertSame('2', $field->getViewData());
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
public function testGroupByChoices()
|
|
|
|
@ -537,7 +537,7 @@ class EntityTypeTest extends TypeTestCase
|
|
|
|
|
|
|
|
|
|
$field->bind('2');
|
|
|
|
|
|
|
|
|
|
$this->assertSame('2', $field->getClientData());
|
|
|
|
|
$this->assertSame('2', $field->getViewData());
|
|
|
|
|
$this->assertEquals(array(
|
|
|
|
|
'Group1' => array(1 => new ChoiceView($item1, '1', 'Foo'), 2 => new ChoiceView($item2, '2', 'Bar')),
|
|
|
|
|
'Group2' => array(3 => new ChoiceView($item3, '3', 'Baz')),
|
|
|
|
@ -716,7 +716,7 @@ class EntityTypeTest extends TypeTestCase
|
|
|
|
|
|
|
|
|
|
$this->assertTrue($field->isSynchronized());
|
|
|
|
|
$this->assertSame($entity1, $field->getData());
|
|
|
|
|
$this->assertSame('foo', $field->getClientData());
|
|
|
|
|
$this->assertSame('foo', $field->getViewData());
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
public function testSubmitCompositeStringIdentifier()
|
|
|
|
@ -738,7 +738,7 @@ class EntityTypeTest extends TypeTestCase
|
|
|
|
|
|
|
|
|
|
$this->assertTrue($field->isSynchronized());
|
|
|
|
|
$this->assertSame($entity1, $field->getData());
|
|
|
|
|
$this->assertSame('0', $field->getClientData());
|
|
|
|
|
$this->assertSame('0', $field->getViewData());
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
public function testGetManagerForClassIfNoEm()
|
|
|
|
|