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();
}