/** * Gets the current collection * * @return MongoCollection */ public function getCollection() { if (is_null($this->collection)) { $cnx = new Connector($this->config); $this->collection = $cnx->getCollection(); } return $this->collection; }
protected function setUp() { $cnx = new Connector(array('server' => 'localhost', 'database' => 'phpunit', 'collection' => 'zero')); $this->collection = $cnx->getCollection(); $this->repository = new Repository($this->collection, new Transformer(new MongoKeyFactory())); }