protected function closeDoctrineConnections()
    {
        foreach (app('db')->getConnections() as $connection) {
            call_user_func(\Closure::bind(function () {
                $this->doctrineConnection = null;
            }, $connection, $connection));
        }
    }
protected function closeDoctrineConnections()
    {
        foreach (app('db')->getConnections() as $connection) {
            call_user_func(\Closure::bind(function () {
                $this->doctrineConnection = null;
            }, $connection, $connection));
        }
    }
protected function closeDoctrineConnections ( ) { foreach ( app ( 'db' ) -> getConnections ( ) as $ connection ) { call_user_func ( \ Closure :: bind ( function ( ) { $ this -> doctrineConnection = null ; } , $ connection , $ connection ) ) ; } }
Close all Doctrine connections in order to prevent "Too many connections"
errors when running many tests.

@return void
Close all Doctrine connections in order to prevent Too many connections errors when running many tests .