/**
  * @return void
  * @author Christopher Hlubek <*****@*****.**>
  */
 public function setUp()
 {
     parent::setUp();
     $this->client = new \TYPO3\CouchDB\Client($this->dataSourceName);
     $this->client->setDatabaseName($this->databaseName);
     if ($this->client->databaseExists($this->databaseName)) {
         $this->client->deleteDatabase($this->databaseName);
     }
     $this->backend = new \TYPO3\CouchDB\Log\Backend\CouchDbBackend(array('databaseName' => $this->databaseName, 'dataSourceName' => $this->dataSourceName));
     $this->backend->open();
 }
 /**
  * @return void
  * @author Christopher Hlubek <*****@*****.**>
  */
 public function setUp()
 {
     parent::setUp();
     $configurationManager = $this->objectManager->get('TYPO3\\Flow\\Configuration\\ConfigurationManager');
     $backendOptions = $this->objectManager->getSettingsByPath(array('TYPO3', 'Flow', 'persistence', 'backendOptions'));
     $this->client = new \TYPO3\CouchDB\Client($backendOptions['dataSourceName']);
     if (isset($backendOptions['database']) && $backendOptions['database'] !== '') {
         $this->client->setDatabaseName($backendOptions['database']);
     }
     $this->design = new \TYPO3\CouchDB\Persistence\Backend\FlowDesign($this->client);
     if ($this->client->databaseExists()) {
         $this->client->deleteDatabase();
     }
 }
 /**
  * Initializes an empty database and setup the needed view code to
  * query for log messages
  *
  * @return void
  * @author Christopher Hlubek <*****@*****.**>
  */
 protected function initializeDatabase()
 {
     if (!$this->client->databaseExists($this->databaseName)) {
         $this->client->createDatabase($this->databaseName);
     }
 }
Example #4
0
 /**
  * Remove the test database
  *
  * @return void
  * @author Christopher Hlubek <*****@*****.**>
  */
 public function tearDown()
 {
     if ($this->client->databaseExists($this->databaseName)) {
         $this->client->deleteDatabase($this->databaseName);
     }
 }