Doctrine\ODM\MongoDB\Tests\BaseTest::setUp PHP Method

setUp() public method

public setUp ( )
    public function setUp()
    {
        $this->dm = $this->createTestDocumentManager();
        $this->uow = $this->dm->getUnitOfWork();
    }

Usage Example

Exemplo n.º 1
0
 public function setUp()
 {
     parent::setUp();
     $this->ids = array();
     $groupA = new Group('groupA');
     $groupB = new Group('groupB');
     $profile = new Profile();
     $profile->setFirstname('Timothy');
     $tim = new User();
     $tim->setUsername('Tim');
     $tim->setHits(10);
     $tim->addGroup($groupA);
     $tim->addGroup($groupB);
     $tim->setProfile($profile);
     $this->dm->persist($tim);
     $john = new User();
     $john->setUsername('John');
     $john->setHits(10);
     $this->dm->persist($john);
     $this->dm->flush();
     $this->dm->clear();
     $this->ids['tim'] = $tim->getId();
     $this->ids['john'] = $john->getId();
     $this->fc = $this->dm->getFilterCollection();
 }
All Usage Examples Of Doctrine\ODM\MongoDB\Tests\BaseTest::setUp