Skip to content

Commit

Permalink
Allow an array for URLs to be consistent with assertRedirect().
Browse files Browse the repository at this point in the history
  • Loading branch information
euromark committed Dec 13, 2014
1 parent 43f053f commit 99f47e1
Show file tree
Hide file tree
Showing 2 changed files with 20 additions and 10 deletions.
16 changes: 8 additions & 8 deletions src/TestSuite/IntegrationTestCase.php
Expand Up @@ -174,7 +174,7 @@ public function cookie($name, $value) {
* a property. You can use various assert methods to check the
* response.
*
* @param string $url The url to request.
* @param string|array $url The URL to request.
* @return void
*/
public function get($url) {
Expand All @@ -188,7 +188,7 @@ public function get($url) {
* a property. You can use various assert methods to check the
* response.
*
* @param string $url The url to request.
* @param string|array $url The URL to request.
* @param array $data The data for the request.
* @return void
*/
Expand All @@ -203,7 +203,7 @@ public function post($url, $data = []) {
* a property. You can use various assert methods to check the
* response.
*
* @param string $url The url to request.
* @param string|array $url The URL to request.
* @param array $data The data for the request.
* @return void
*/
Expand All @@ -218,7 +218,7 @@ public function patch($url, $data = []) {
* a property. You can use various assert methods to check the
* response.
*
* @param string $url The url to request.
* @param string|array $url The URL to request.
* @param array $data The data for the request.
* @return void
*/
Expand All @@ -233,7 +233,7 @@ public function put($url, $data = []) {
* a property. You can use various assert methods to check the
* response.
*
* @param string $url The url to request.
* @param string|array $url The URL to request.
* @return void
*/
public function delete($url) {
Expand All @@ -245,7 +245,7 @@ public function delete($url) {
*
* Receives and stores the response for future inspection.
*
* @param string $url The url
* @param string|array $url The URL
* @param string $method The HTTP method
* @param array|null $data The request data.
* @return void
Expand Down Expand Up @@ -313,7 +313,7 @@ protected function _handleError($exception) {
/**
* Create a request object with the configured options and parameters.
*
* @param string $url The url
* @param string|array $url The URL
* @param string $method The HTTP method
* @param array|null $data The request data.
* @return \Cake\Network\Request The built request.
Expand All @@ -326,7 +326,7 @@ protected function _buildRequest($url, $method, $data) {
$session->write($this->_session);

$props = [
'url' => $url,
'url' => Router::url($url),
'post' => $data,
'cookies' => $this->_cookie,
'session' => $session,
Expand Down
14 changes: 12 additions & 2 deletions tests/TestCase/TestSuite/IntegrationTestCaseTest.php
Expand Up @@ -92,6 +92,16 @@ public function testRequestSetsProperties() {
$this->assertEquals('value', $this->viewVariable('test'));
}

/**
* Test array URLs
*
* @return void
*/
public function testArrayUrls() {
$this->post(['controller' => 'Posts', 'action' => 'index']);
$this->assertEquals('value', $this->viewVariable('test'));
}

/**
* Test flash and cookie assertions
*
Expand Down Expand Up @@ -196,10 +206,10 @@ public function testAssertResponseContains() {
}

/**
* Test that works in tandem with testEventManagerReset2 to
* Test that works in tandem with testEventManagerReset2 to
* test the EventManager reset.
*
* The return value is passed to testEventManagerReset2 as
* The return value is passed to testEventManagerReset2 as
* an arguments.
*
* @return \Cake\Event\EventManager
Expand Down

0 comments on commit 99f47e1

Please sign in to comment.