Ejemplo n.º 1
0
 protected function setUp()
 {
     $this->obj1 = (object) array('name' => 'A');
     $this->obj2 = (object) array('name' => 'B');
     $this->obj3 = (object) array('name' => 'C');
     $this->obj4 = (object) array('name' => 'D');
     parent::setUp();
 }
Ejemplo n.º 2
0
 protected function setUp()
 {
     $this->obj1 = new \stdClass();
     $this->obj2 = new \stdClass();
     $this->obj3 = new \stdClass();
     $this->obj4 = new \stdClass();
     parent::setUp();
 }
 protected function setUp()
 {
     $this->query = $this->getMock('Symfony\\Bridge\\Propel1\\Tests\\Fixtures\\ItemQuery', array('filterById'), array(), '', true, true, true, false, true);
     $this->query->expects($this->any())->method('filterById')->with($this->anything())->will($this->returnSelf());
     $this->createItems();
     ItemQuery::$result = array($this->item1, $this->item2, $this->item3, $this->item4);
     parent::setUp();
 }
Ejemplo n.º 4
0
 protected function setUp()
 {
     $this->em = DoctrineTestHelper::createTestEntityManager();
     $schemaTool = new SchemaTool($this->em);
     $classes = $this->getClassesMetadata();
     try {
         $schemaTool->dropSchema($classes);
     } catch (\Exception $e) {
     }
     try {
         $schemaTool->createSchema($classes);
     } catch (\Exception $e) {
     }
     list($this->obj1, $this->obj2, $this->obj3, $this->obj4) = $this->createObjects();
     $this->em->persist($this->obj1);
     $this->em->persist($this->obj2);
     $this->em->persist($this->obj3);
     $this->em->persist($this->obj4);
     $this->em->flush();
     parent::setUp();
 }
 protected function setUp()
 {
     if (!class_exists('Symfony\\Component\\Form\\Form')) {
         $this->markTestSkipped('The "Form" component is not available');
     }
     if (!class_exists('Doctrine\\DBAL\\Platforms\\MySqlPlatform')) {
         $this->markTestSkipped('Doctrine DBAL is not available.');
     }
     if (!class_exists('Doctrine\\Common\\Version')) {
         $this->markTestSkipped('Doctrine Common is not available.');
     }
     if (!class_exists('Doctrine\\ORM\\EntityManager')) {
         $this->markTestSkipped('Doctrine ORM is not available.');
     }
     $this->em = DoctrineTestHelper::createTestEntityManager();
     $schemaTool = new SchemaTool($this->em);
     $classes = array($this->em->getClassMetadata($this->getEntityClass()));
     try {
         $schemaTool->dropSchema($classes);
     } catch (\Exception $e) {
     }
     try {
         $schemaTool->createSchema($classes);
     } catch (\Exception $e) {
     }
     list($this->obj1, $this->obj2, $this->obj3, $this->obj4) = $this->createObjects();
     $this->em->persist($this->obj1);
     $this->em->persist($this->obj2);
     $this->em->persist($this->obj3);
     $this->em->persist($this->obj4);
     $this->em->flush();
     parent::setUp();
 }