示例#1
0
 /**
  * Tests the connection and clears the database for preparation for tests.
  */
 public function testConnection()
 {
     $store = $this->repository->getStore();
     $store->getDatabase()->dropCollection($this->repository->getCollection());
     $this->assertInstanceOf(MongoClient::class, $store->getClient());
 }
示例#2
0
 /**
  * Tests that an exception is thrown when the query fails.
  *
  * @depends           testInsert
  * @expectedException \Knit\Exceptions\StoreQueryErrorException
  */
 public function testRemoveError()
 {
     $this->repository->getStore()->remove($this->repository->getCollection(), new CriteriaExpression(['no_such_column' => 45]));
 }