Example #1
0
 public function setUp()
 {
     $this->chainClass = 'Psc\\CMS\\EntityFormPanel';
     parent::setUp();
     $entity = new Person('Scheit');
     $entity->setFirstName('Philipp');
     $entity->setBirthday(new Date('21.11.1984'));
     $entity->setEmail('*****@*****.**');
     $this->panel = new EntityFormPanel('Person bearbeiten', $this->getTranslationContainer(), new EntityForm($entity, $this->getEntityMeta('Psc\\Doctrine\\TestEntities\\Person')->getSaveRequestMeta($entity)));
 }
 public function testAcceptance()
 {
     // $this->doublesManager->buildEntityRepository() == $this->builder
     $person = new Person('Me');
     $person->setIdentifier(7);
     $otherPerson = new Person('other');
     $otherPerson->setIdentifier(2);
     $repository = $this->builder->setEntityName('Psc\\Doctrine\\TestEntities\\Person')->expectHydrates($person, $this->any())->end()->expectSaves($otherPerson, $this->once())->end()->build();
     $this->assertInstanceOf('PHPUnit_Framework_MockObject_MockObject', $repository);
     $this->assertInstanceOf('Psc\\Doctrine\\EntityRepository', $repository);
     $this->assertInstanceOf('Psc\\Doctrine\\EntityRepository', $repository->save($otherPerson));
     $this->assertSame($person, $repository->hydrate(7));
     $this->assertSame($person, $repository->hydrate(7));
 }