File tree Expand file tree Collapse file tree 3 files changed +49
-1
lines changed Expand file tree Collapse file tree 3 files changed +49
-1
lines changed Original file line number Diff line number Diff line change @@ -2034,4 +2034,29 @@ protected function getNormalizedResponseContent()
2034
2034
2035
2035
return $ content ;
2036
2036
}
2037
+
2038
+ /**
2039
+ * Sets SERVER parameters valid for all next requests.
2040
+ * this will remove old ones.
2041
+ *
2042
+ * ```php
2043
+ * $I->setServerParameters([]);
2044
+ * ```
2045
+ */
2046
+ public function setServerParameters (array $ params )
2047
+ {
2048
+ $ this ->client ->setServerParameters ($ params );
2049
+ }
2050
+
2051
+ /**
2052
+ * Sets SERVER parameter valid for all next requests.
2053
+ *
2054
+ * ```php
2055
+ * $I->haveServerParameter('name', 'value');
2056
+ * ```
2057
+ */
2058
+ public function haveServerParameter ($ name , $ value )
2059
+ {
2060
+ $ this ->client ->setServerParameter ($ name , $ value );
2061
+ }
2037
2062
}
Original file line number Diff line number Diff line change 1
- a:0:{}
1
+ a:0:{}
Original file line number Diff line number Diff line change @@ -1746,4 +1746,27 @@ public function testPasswordArgument()
1746
1746
$ data = data::get ('form ' );
1747
1747
$ this ->assertEquals ('thisissecret ' , $ data ['password ' ]);
1748
1748
}
1749
+
1750
+
1751
+ public function testCanResetHTTPAuthenticated ()
1752
+ {
1753
+ $ this ->module ->amHttpAuthenticated ('user ' , 'pass ' );
1754
+ $ this ->module ->amOnPage ('/ ' );
1755
+ $ server = $ this ->module ->client ->getRequest ()->getServer ();
1756
+ $ this ->assertArrayHasKey ('PHP_AUTH_USER ' , $ server );
1757
+ $ this ->assertArrayHasKey ('PHP_AUTH_PW ' , $ server );
1758
+ $ this ->module ->setServerParameters ([]);
1759
+ $ this ->module ->amOnPage ('/ ' );
1760
+ $ server = $ this ->module ->client ->getRequest ()->getServer ();
1761
+ $ this ->assertArrayNotHasKey ('PHP_AUTH_USER ' , $ server );
1762
+ $ this ->assertArrayNotHasKey ('PHP_AUTH_PW ' , $ server );
1763
+ }
1764
+
1765
+ public function testHaveServerParameter ()
1766
+ {
1767
+ $ this ->module ->haveServerParameter ('my ' , 'param ' );
1768
+ $ this ->module ->amOnPage ('/ ' );
1769
+ $ server = $ this ->module ->client ->getRequest ()->getServer ();
1770
+ $ this ->assertArrayHasKey ('my ' , $ server );
1771
+ }
1749
1772
}
You can’t perform that action at this time.
0 commit comments