File tree Expand file tree Collapse file tree 1 file changed +32
-0
lines changed
Expand file tree Collapse file tree 1 file changed +32
-0
lines changed Original file line number Diff line number Diff line change 1+ <?php
2+
3+ namespace Tests \Unit ;
4+
5+ use Tests \TestCase ;
6+ use Illuminate \Support \Facades \Session ;
7+ use Oneofftech \Identities \Support \InteractsWithPreviousUrl ;
8+
9+ class InteractWithPreviousUrlTest extends TestCase
10+ {
11+ use InteractsWithPreviousUrl;
12+
13+ public function test_previous_url_is_stored ()
14+ {
15+ Session::shouldReceive ('previousUrl ' )->andReturn ('http://localhost/previous ' );
16+
17+ Session::shouldReceive ('put ' )->once ()->with ('_oot.identities.previous_url ' , 'http://localhost/previous ' );
18+
19+ $ this ->savePreviousUrl ();
20+ }
21+
22+ public function test_previous_url_can_be_retrieved ()
23+ {
24+ Session::shouldReceive ('previousUrl ' )->andReturnNull ();
25+
26+ Session::shouldReceive ('pull ' )->once ()->with ('_oot.identities.previous_url ' , 'http://localhost ' )->andReturn ('http://localhost/previous ' );
27+
28+ $ url = $ this ->getPreviousUrl ();
29+
30+ $ this ->assertEquals ('http://localhost/previous ' , $ url );
31+ }
32+ }
You can’t perform that action at this time.
0 commit comments