Example #1
0
    /**
     * Test the authentication error (401 Unauthorized - Bad username or password)
     *
     * @return void
     */
    public function testAuthenticateError()
    {
        $this->_files->getHttpClient()
                    ->setAdapter($this->_httpClientAdapterTest);

        $this->_httpClientAdapterTest->setResponse($this->_loadResponse(__FUNCTION__));

        $this->assertFalse($this->_files->authenticate());
        $this->assertFalse($this->_files->isSuccessful());
        $this->assertEquals($this->_files->getErrorStatus(),'401');
        $this->assertEquals($this->_files->getErrorMsg(),'Bad username or password');

    }