Sokil\Mongo\CursorTest::testLogger PHP Method

testLogger() public method

public testLogger ( )
    public function testLogger()
    {
        // create documents
        $this->collection->createDocument(array('param' => 1))->save();
        $this->collection->createDocument(array('param' => 2))->save();
        $this->collection->createDocument(array('param' => 3))->save();
        $this->collection->createDocument(array('param' => 4))->save();
        // create logger
        $logger = $this->getMock('\\Psr\\Log\\LoggerInterface');
        $logger->expects($this->once())->method('debug')->with('Sokil\\Mongo\\Cursor: {"collection":"phpmongo_test_collection","query":{"param":2},"project":[],"sort":[]}');
        // set logger to client
        $this->collection->getDatabase()->getClient()->setLogger($logger);
        // aggregate
        $this->collection->find()->where('param', 2)->findAll();
    }