public function testFilterFiltersNonRootWithCascadeOn()
{
$entity = new AnnotatedClass();
$form = $this->getMockForm();
$parentForm = $this->getMockForm();
$config = $this->getMock('Symfony\\Component\\Form\\FormConfigInterface');
$form->expects($this->exactly(2))->method('isRoot')->will($this->returnValue(false));
$form->expects($this->once())->method('getParent')->will($this->returnValue($parentForm));
$form->expects($this->once())->method('getData')->will($this->returnValue($entity));
$parentForm->expects($this->once())->method('isRoot')->will($this->returnValue(true));
$parentForm->expects($this->once())->method('getConfig')->will($this->returnValue($config));
$config->expects($this->once())->method('getOption')->will($this->returnValue(true));
$this->delegate->expects($this->once())->method('filterEntity');
$this->listener->onPostSubmit(new FormEvent($form, null));
}