Re: testAction returns null after redirect

2014-07-27 Thread walter
The root url I was set as '/' if you mean it. 

Below my setings from the routes.php

Router::connect('/', array('controller' => 'questions', 'action' => 
'index', 'id' => 1, '[method]' => 'GET'), array('pass' => array('id'))); // 
I do redirect to this url.

/**
 * Load the CakePHP default routes. Only remove this if you do not want to 
use
 * the built-in default routes.
 */
//require CAKE . 'Config' . DS . 'routes.php';




Неділя, 27 липня 2014 р. 15:52:16 UTC+3 користувач euromark написав:
>
> That looks like a known issue for travis and some local setups.
> This is supposed to be document root (/) right?
>
> mark
>

-- 
Like Us on FaceBook https://www.facebook.com/CakePHP
Find us on Twitter http://twitter.com/CakePHP

--- 
You received this message because you are subscribed to the Google Groups 
"CakePHP" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to cake-php+unsubscr...@googlegroups.com.
To post to this group, send email to cake-php@googlegroups.com.
Visit this group at http://groups.google.com/group/cake-php.
For more options, visit https://groups.google.com/d/optout.


Re: testAction returns null after redirect

2014-07-27 Thread euromark
That looks like a known issue for travis and some local setups.
This is supposed to be document root (/) right?

mark


Am Sonntag, 27. Juli 2014 09:56:47 UTC+2 schrieb walter:
>
> Im new in CakePHP.
>
> That's result of debug($this->headers);
>
> 'Location' => '
> http://localhost/home/walter/Projects/workspace/QA/app/Console/'
>

-- 
Like Us on FaceBook https://www.facebook.com/CakePHP
Find us on Twitter http://twitter.com/CakePHP

--- 
You received this message because you are subscribed to the Google Groups 
"CakePHP" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to cake-php+unsubscr...@googlegroups.com.
To post to this group, send email to cake-php@googlegroups.com.
Visit this group at http://groups.google.com/group/cake-php.
For more options, visit https://groups.google.com/d/optout.


Re: testAction returns null after redirect

2014-07-27 Thread walter
Im new in CakePHP.

That's result of debug($this->headers);

'Location' => 
'http://localhost/home/walter/Projects/workspace/QA/app/Console/'

-- 
Like Us on FaceBook https://www.facebook.com/CakePHP
Find us on Twitter http://twitter.com/CakePHP

--- 
You received this message because you are subscribed to the Google Groups 
"CakePHP" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to cake-php+unsubscr...@googlegroups.com.
To post to this group, send email to cake-php@googlegroups.com.
Visit this group at http://groups.google.com/group/cake-php.
For more options, visit https://groups.google.com/d/optout.


Re: testAction returns null after redirect

2014-07-26 Thread euromark
http://stackoverflow.com/questions/24964348/cakephp-testaction-returns-null-after-redirect


Am Samstag, 26. Juli 2014 11:45:45 UTC+2 schrieb walter:
>
> I test a controller action. I pass data to it via the POST method. After 
> saving a data into DB I do a redirect to a main page where I display a 
> message about of action result.
>
> I want to test whether this behavior and text of the message equal to 
> expected, but I get a null instead of the $this->contents value.
>
> Yet, all data saved and messages displayed successfully via the browser.
>
> Below is my call of a testAction
>
> $res = $this->testAction('/ask', array_merge(array('return' => 'contents'), 
> array('data' => $fields_data, 'method' => 'post')));
>
>

-- 
Like Us on FaceBook https://www.facebook.com/CakePHP
Find us on Twitter http://twitter.com/CakePHP

--- 
You received this message because you are subscribed to the Google Groups 
"CakePHP" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to cake-php+unsubscr...@googlegroups.com.
To post to this group, send email to cake-php@googlegroups.com.
Visit this group at http://groups.google.com/group/cake-php.
For more options, visit https://groups.google.com/d/optout.


Re: testAction returns null after redirect

2014-07-26 Thread euromark
Of course the result is null when the response only contains the redirect 
headers.
You can read those headers - including the session value stored in your 
test method.

See $this->headers['Location'] and CakeSession::read('message') or sth

mark


Am Samstag, 26. Juli 2014 11:45:45 UTC+2 schrieb walter:
>
> I test a controller action. I pass data to it via the POST method. After 
> saving a data into DB I do a redirect to a main page where I display a 
> message about of action result.
>
> I want to test whether this behavior and text of the message equal to 
> expected, but I get a null instead of the $this->contents value.
>
> Yet, all data saved and messages displayed successfully via the browser.
>
> Below is my call of a testAction
>
> $res = $this->testAction('/ask', array_merge(array('return' => 'contents'), 
> array('data' => $fields_data, 'method' => 'post')));
>
>

-- 
Like Us on FaceBook https://www.facebook.com/CakePHP
Find us on Twitter http://twitter.com/CakePHP

--- 
You received this message because you are subscribed to the Google Groups 
"CakePHP" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to cake-php+unsubscr...@googlegroups.com.
To post to this group, send email to cake-php@googlegroups.com.
Visit this group at http://groups.google.com/group/cake-php.
For more options, visit https://groups.google.com/d/optout.