persistConnect() public method

Creates a persistent connection with a database server
Deprecation: Pass array("persist" => $id) to the constructor instead of using this method.
public persistConnect ( string $username = "", string $password = "" ) : boolean
$username string A username used to identify the connection.
$password string A password used to identify the connection.
return boolean If the connection was successful.
    /**
     * @expectedException PHPUnit_Framework_Error
     */
    public function testPersistConn() {
      $m1 = new Mongo("localhost", array("persist" => ""));

      // uses the same connection as $m1
      $m2 = new Mongo("localhost", array("persist" => ""));
      $m2->persistConnect();

      // creates a new connection
      $m3 = new Mongo("127.0.0.1", array("persist" => ""));
      $m3->persistConnect();

      // creates a new connection
      $m4 = new Mongo("127.0.0.1:27017", array("persist" => ""));
      $m4->persistConnect();

      // creates a new connection
      $m5 = new Mongo("localhost", array("persist" => ""));
      $m5->persistConnect("foo");

      // uses the $m5 connection
      $m6 = new Mongo("localhost", array("persist" => ""));
      $m6->persistConnect("foo");

      // uses $md5
      $m7 = new Mongo("localhost", array("persist" => ""));
      $m7->persistConnect("foo", "bar");

      $m8 = new Mongo();
    }