public static function setUpBeforeClass() { self::$config = ['database' => 'reach_testing', 'host' => 'localhost', 'port' => 27017, 'options' => ['connect' => true, 'socketTimeoutMS' => 60000]]; \Reach\Service\Container::register('mongo', self::$config, '\\Reach\\Mongo\\Connection'); self::$connection = \Reach\Service\Container::getDI()->get('mongo'); //ConnectionManager::registerConnection(self::$config); //self::$connection = ConnectionManager::getConnection(); if (!self::$phactory) { if (!self::$connection->getDb() instanceof \MongoDB) { throw new \Exception('Could not connect to MongoDB'); } self::$phactory = new Phactory(self::$connection->getDb()); self::$phactory->reset(); } //set up Phactory db connection self::$phactory->reset(); }
public static function setUpBeforeClass() { self::$config = ['class' => '\\Reach\\Sphinx\\Connection', 'host' => 'localhost', 'port' => 9312]; \Reach\Service\Container::register('sphinx', self::$config); self::$connection = \Reach\Service\Container::get('sphinx'); }