Doctrine\OrientDB\Binding\HttpBinding::setAuthentication PHP Method

setAuthentication() public method

public setAuthentication ( $username = null, $password = null )
    public function setAuthentication($username = null, $password = null)
    {
        $this->adapter->setAuthentication($username, $password);
    }

Usage Example

Ejemplo n.º 1
0
 public function testSettingAuthentication()
 {
     $adapter = $this->getMock('Doctrine\\OrientDB\\Binding\\Adapter\\HttpClientAdapterInterface');
     $adapter->expects($this->at(1))->method('setAuthentication')->with(null, null);
     $adapter->expects($this->at(2))->method('setAuthentication')->with(TEST_ODB_USER, TEST_ODB_PASSWORD);
     $parameters = new BindingParameters();
     $binding = new HttpBinding($parameters, $adapter);
     $binding->setAuthentication();
     $binding->setAuthentication(TEST_ODB_USER, TEST_ODB_PASSWORD);
 }