File tree 1 file changed +39
-0
lines changed
1 file changed +39
-0
lines changed Original file line number Diff line number Diff line change @@ -455,6 +455,45 @@ public function seeInCurrentRoute($routeName)
455
455
$ this ->assertEquals ($ matchedRouteName , $ routeName );
456
456
}
457
457
458
+ /**
459
+ * Goes to a page and check that it can be accessed.
460
+ *
461
+ * ```php
462
+ * <?php
463
+ * $I->seePageIsAvailable('/dashboard');
464
+ * ```
465
+ *
466
+ * @param string $url
467
+ */
468
+ public function seePageIsAvailable ($ url )
469
+ {
470
+ $ this ->amOnPage ($ url );
471
+ $ this ->seeResponseCodeIsSuccessful ();
472
+ $ this ->seeInCurrentUrl ($ url );
473
+ }
474
+
475
+ /**
476
+ * Goes to a page and check that it redirects to another.
477
+ *
478
+ * ```php
479
+ * <?php
480
+ * $I->seePageRedirectsTo('/admin', '/login');
481
+ * ```
482
+ *
483
+ * @param string $page
484
+ * @param string $redirectsTo
485
+ */
486
+ public function seePageRedirectsTo ($ page , $ redirectsTo )
487
+ {
488
+ $ this ->client ->followRedirects (false );
489
+ $ this ->amOnPage ($ page );
490
+ $ this ->assertTrue (
491
+ $ this ->client ->getResponse ()->isRedirection ()
492
+ );
493
+ $ this ->client ->followRedirect ();
494
+ $ this ->seeInCurrentUrl ($ redirectsTo );
495
+ }
496
+
458
497
/**
459
498
* Checks if the desired number of emails was sent.
460
499
* If no argument is provided then at least one email must be sent to satisfy the check.
You can’t perform that action at this time.
0 commit comments