zendframework/zf2 — pull request #6886 by SenseException (2014-11-17 22:21:53+00:00)
Title: Set user and password in Http class

Zend\Uri\Http is extending Zend\Uri\Uri and therefore is also having the getter and setter method for the user info from an URI. Also, the Http class has separate setter and getter for the user and password.

At the moment, when the user info is set, Http automatically is setting the properties for user and password.

```php
$uri = new Http('http://example.com/');
$uri->normalize();
$uri->setUserInfo('user:pass');
$this->assertEquals('user', $uri->getUser());
$this->assertEquals('pass', $uri->getPassword());
```

But when values are set with setUser and setPassword, the user info is not updated. The following test fails:

```php
$uri = new HttpUri('http://example.com/');
$uri->setUser('user');
$uri->setPassword('pass');
$this->assertEquals('user:pass', $uri->getUserInfo());
```

It is a strange behaviour that setting the user info is also setting the user and password in Http class, but the setter of user and password doesn't affect the user info value.

I created this pull request with a fix of this behaviour and add some more unittests for Http.