Skip to content

Commit

Permalink
Add tests for SessionStorage::redirectUrl()
Browse files Browse the repository at this point in the history
  • Loading branch information
ADmad committed May 31, 2015
1 parent 6309bbd commit 30efc38
Showing 1 changed file with 30 additions and 0 deletions.
30 changes: 30 additions & 0 deletions tests/TestCase/Auth/Storage/SessionStorageTest.php
Expand Up @@ -102,4 +102,34 @@ public function testDelete()

$this->storage->delete();
}

/**
* Test redirectUrl()
*
* @return void
*/
public function redirectUrl()
{
$url = '/url';

$this->session->expects($this->once())
->method('write')
->with('Auth.redirectUrl', $url);

$this->storage->redirectUrl($url);

$this->session->expects($this->once())
->method('read')
->with('Auth.redirectUrl')
->will($this->returnValue($url));

$result = $this->storage->redirectUrl();
$this->assertEquals($url, $result);

$this->session->expects($this->once())
->method('delete')
->with('Auth.redirectUrl');

$this->storage->redirectUrl(false);
}
}

0 comments on commit 30efc38

Please sign in to comment.