Skip to content
This repository has been archived by the owner on Jan 8, 2020. It is now read-only.

Commit

Permalink
#6886 - should allow null user and password being set
Browse files Browse the repository at this point in the history
  • Loading branch information
Ocramius committed Nov 18, 2014
1 parent 651f84e commit 48ae839
Showing 1 changed file with 29 additions and 0 deletions.
29 changes: 29 additions & 0 deletions tests/ZendTest/Uri/HttpTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -301,4 +301,33 @@ public function testCanSetUserInfoWithUser()
$uri->setUser('user');
$this->assertSame('user', $uri->getUserInfo());
}

/**
* @group 6886
*/
public function testCanSetNullUser()
{
$uri = new HttpUri('http://www.example.com/');

$uri->setUserInfo('user:password');
$uri->setUser(null);

$this->assertNull($uri->getUser());
$this->assertSame('password', $uri->getPassword());
}

/**
* @group 6886
*/
public function testCanSetNullPassword()
{
$uri = new HttpUri('http://www.example.com/');

$uri->setUserInfo('user:password');
$uri->setPassword(null);

$this->assertSame('user', $uri->getUser());
$this->assertNull($uri->getPassword());
$this->assertSame('user', $uri->getUserInfo());
}
}

0 comments on commit 48ae839

Please sign in to comment.