Ejemplo n.º 1
0
 /**
  * @BeforeScenario
  */
 public function purgeAndInitializeDatabase()
 {
     $purger = new PHPCRPurger($this->documentManager);
     $purger->purge();
     $this->documentManager->clear();
     $this->initializerManager->initialize();
 }
Ejemplo n.º 2
0
 /**
  * {@inheritdoc}
  */
 public function beforeSuite(SuiteEvent $suiteEvent, array $options)
 {
     foreach ($options['managers'] as $managerName) {
         /** @var DocumentManagerInterface $manager */
         $manager = $this->managerRegistry->getManager($managerName);
         $purger = new PHPCRPurger($manager);
         $purger->purge();
     }
 }
Ejemplo n.º 3
0
 public function startTest(\PHPUnit_Framework_Test $test)
 {
     switch (static::$currentSuite->getName()) {
         case 'orm':
             $db = $test->getDbManager('ORM');
             $purger = new Purger\ORMPurger($db->getOm());
             break;
         case 'phpcr':
             $db = $test->getDbManager('PHPCR');
             $purger = new Purger\PHPCRPurger($db->getOm());
             break;
         default:
             return;
     }
     $purger->purge();
 }