Mongolid\Connection\PoolTest::testShouldGetNullConnectionFromPoolIfItsEmpty PHP Method

testShouldGetNullConnectionFromPoolIfItsEmpty() public method

    public function testShouldGetNullConnectionFromPoolIfItsEmpty()
    {
        // Arrange
        $pool = new Pool();
        $connQueue = m::mock();
        $this->setProtected($pool, 'connections', $connQueue);
        // Act
        $connQueue->shouldReceive('pop')->once()->andReturn(null);
        $connQueue->shouldReceive('push')->never();
        // Assert
        $this->assertNull($pool->getConnection());
    }