Ejemplo n.º 1
0
 public function testSave()
 {
     include_once __DIR__ . '/_files/MongoBinData.txt';
     $inputAssertion = $this->logicalAnd($this->arrayHasKey('_id'), $this->arrayHasKey('data'), $this->arrayHasKey('tags'), $this->arrayHasKey('mtime'), $this->arrayHasKey('expire'));
     $this->_collection->expects($this->once())->method('save')->with($inputAssertion)->will($this->returnValue(true));
     $this->assertTrue($this->_model->save('test data', 'test_id', ['tag1', 'tag2'], 100));
 }
Ejemplo n.º 2
0
 /**
  * Fill the collection with data
  */
 protected function _prepareCollection()
 {
     $this->_model->save('test data 1', 'test1', ['tag1', 'tag2', 'tag3']);
     $this->_model->save('test data 2', 'test2', ['tag1', 'tag3']);
     $this->_model->save('test data 3', 'test3', ['tag2', 'tag1']);
     $this->_model->save('test data 4', 'test4', ['tag4', 'tag5']);
     $this->_model->save('test data 5', 'test5', []);
 }