Example #1
0
 public function testMandangoLoggerWithLoggerCallable()
 {
     $connection = new Connection($this->server, $this->dbName);
     $connection->setLoggerCallable($loggerCallable = array($this, 'log'));
     $connection->setLogDefault($logDefault = array('foo' => 'bar'));
     $mongo = $connection->getMongo();
     $mongoDB = $connection->getMongoDB();
     $this->assertInstanceOf('\\Mandango\\Logger\\LoggableMongo', $mongo);
     $this->assertInstanceOf('\\Mandango\\Logger\\LoggableMongoDB', $mongoDB);
     $this->assertSame($loggerCallable, $mongo->getLoggerCallable());
     $this->assertSame($logDefault, $mongo->getLogDefault());
     $this->assertSame($this->dbName, $mongoDB->__toString());
     $this->assertSame($mongo, $connection->getMongo());
     $this->assertSame($mongoDB, $connection->getMongoDB());
 }