コード例 #1
0
ファイル: MongoDBTest.php プロジェクト: rajanlamic/IntTest
 public function testWriteConvertsDateTimeToMongoDate()
 {
     $date = new DateTime();
     $event = array('timestamp' => $date);
     $this->mongoCollection->expects($this->once())->method('save')->with($this->contains(new MongoDate($date->getTimestamp()), false));
     $writer = new MongoDBWriter($this->mongo, $this->database, $this->collection);
     $writer->write($event);
 }
コード例 #2
0
ファイル: MongoDBTest.php プロジェクト: robertodormepoco/zf2
 public function testWriteWithCustomSaveOptions()
 {
     $event = array('message' => 'foo', 'priority' => 42);
     $saveOptions = array('safe' => false, 'fsync' => false, 'timeout' => 100);
     $this->mongoCollection->expects($this->once())->method('save')->with($event, $saveOptions);
     $writer = new MongoDBWriter($this->mongo, $this->database, $this->collection, $saveOptions);
     $writer->write($event);
 }