Permalink
Browse files

Fix tests using MongoBinData to pass BYTE_ARRAY constant.

  • Loading branch information...
1 parent 951b133 commit e3c9482693d1d68bcef785ad220d21d48408f27c Brian Feaver committed Mar 15, 2013
Showing with 5 additions and 5 deletions.
  1. +1 −1 Tests/DataCollector/PrettyDataCollectorTest.php
  2. +4 −4 Tests/Logger/LoggerTest.php
@@ -45,7 +45,7 @@ public function getQueries()
array('use foo;', 'db.bar.find({ "foo": null });'),
),
'bin data' => array(
- array('db' => 'foo', 'collection' => 'bar', 'update' => true, 'query' => array('_id' => 'foo'), 'newObj' => array('foo' => new \MongoBinData('junk data'))),
+ array('db' => 'foo', 'collection' => 'bar', 'update' => true, 'query' => array('_id' => 'foo'), 'newObj' => array('foo' => new \MongoBinData('junk data', \MongoBinData::BYTE_ARRAY))),
arraY('use foo;', 'db.bar.update({ "_id": "foo" }, { "foo": new BinData(2, "' . base64_encode('junk data') . '") });'),
)
);
@@ -45,7 +45,7 @@ public function testLogQuery()
public function testMongoBinDataBase64Encoded()
{
- $binData = new \MongoBinData('junk data');
+ $binData = new \MongoBinData('junk data', \MongoBinData::BYTE_ARRAY);
$query = array('foo' => base64_encode($binData->bin));
$log = json_encode($query);
@@ -54,12 +54,12 @@ public function testMongoBinDataBase64Encoded()
->with('MongoDB query: '.$log);
$logger = new Logger($this->logger);
- $logger->logQuery(array('foo' => new \MongoBinData('junk data')));
+ $logger->logQuery(array('foo' => new \MongoBinData('junk data', \MongoBinData::BYTE_ARRAY)));
}
public function testMongoBinDataBase64EncodedRecursively()
{
- $binData = new \MongoBinData('junk data');
+ $binData = new \MongoBinData('junk data', \MongoBinData::BYTE_ARRAY);
$query = array('foo' => array('bar' => base64_encode($binData->bin)));
$log = json_encode($query);
@@ -68,6 +68,6 @@ public function testMongoBinDataBase64EncodedRecursively()
->with('MongoDB query: '.$log);
$logger = new Logger($this->logger);
- $logger->logQuery(array('foo' => array('bar' => new \MongoBinData('junk data'))));
+ $logger->logQuery(array('foo' => array('bar' => new \MongoBinData('junk data', \MongoBinData::BYTE_ARRAY))));
}
}

0 comments on commit e3c9482

Please sign in to comment.