Neos\Flow\Tests\FunctionalTestCase::setUp PHP Method

setUp() public method

If you override this method, don't forget to call parent::setUp() in your own implementation.
public setUp ( ) : void
return void
    public function setUp()
    {
        $this->objectManager = self::$bootstrap->getObjectManager();
        $this->cleanupPersistentResourcesDirectory();
        self::$bootstrap->getObjectManager()->forgetInstance(\Neos\Flow\ResourceManagement\ResourceManager::class);
        $session = $this->objectManager->get(\Neos\Flow\Session\SessionInterface::class);
        if ($session->isStarted()) {
            $session->destroy(sprintf('assure that session is fresh, in setUp() method of functional test %s.', get_class($this) . '::' . $this->getName()));
        }
        if ($this->testableSecurityEnabled === true || static::$testablePersistenceEnabled === true) {
            if (is_callable(array(self::$bootstrap->getObjectManager()->get(\Neos\Flow\Persistence\PersistenceManagerInterface::class), 'compile'))) {
                $result = self::$bootstrap->getObjectManager()->get(\Neos\Flow\Persistence\PersistenceManagerInterface::class)->compile();
                if ($result === false) {
                    self::markTestSkipped('Test skipped because setting up the persistence failed.');
                }
            }
            $this->persistenceManager = $this->objectManager->get(\Neos\Flow\Persistence\PersistenceManagerInterface::class);
        } else {
            $privilegeManager = $this->objectManager->get(\Neos\Flow\Security\Authorization\TestingPrivilegeManager::class);
            $privilegeManager->setOverrideDecision(true);
        }
        // HTTP must be initialized before Session and Security because they rely
        // on an HTTP request being available via the request handler:
        $this->setupHttp();
        $session = $this->objectManager->get(\Neos\Flow\Session\SessionInterface::class);
        if ($session->isStarted()) {
            $session->destroy(sprintf('assure that session is fresh, in setUp() method of functional test %s.', get_class($this) . '::' . $this->getName()));
        }
        $this->setupSecurity();
    }

Usage Example

 /**
  * @return void
  */
 public function setUp()
 {
     parent::setUp();
     if (!$this->persistenceManager instanceof PersistenceManager) {
         $this->markTestSkipped('Doctrine persistence is not enabled');
     }
 }
All Usage Examples Of Neos\Flow\Tests\FunctionalTestCase::setUp