before reaching a possible redirect: empty($this->data) is true when
entering the method itself...
As for the redirect I think I already handle that with
class TestPapers extends PapersController {
var $autoRender = false;
function redirect($url, $status = null, $exit = true) {
$this->redirectUrl = $url;
}
but the problem, as I said, it's that no data is passed to the action...
John Andersen wrote:
> Is your add action using a redirect?
> John
>
> On Dec 26, 6:48 pm, Lorenzo Bettini <bett...@dsi.unifi.it> wrote:
>> Hi
>>
>> I already managed to test some actions of controllers using testAction
>> method; these were actions that were expected to return something.
>>
>> Now, I'd like to test an add action of the controller, thus, following
>> the book I did:
>>
>> $data = array(
>> 'Paper' => array(
>> 'title' => 'MyTitle',
>> 'year' => 2009
>> ));
>> debug($data);
>> $results = $this->testAction(
>> array(
>> 'controller' => 'papers',
>> 'action' => 'admin_add',
>> ),
>> array('data' => $data, 'method' => 'post')
>> );
>>
>> but when executing the controller's action (I tried that with the
>> debug), the $this->data is always empty and uninitialized... where am I
>> going wrong?
>>
>> thanks in advance
>> Lorenzo
--
Lorenzo Bettini, PhD in Computer Science, DI, Univ. Torino
HOME: http://www.lorenzobettini.it MUSIC: http://www.purplesucker.com
BLOGS: http://tronprog.blogspot.com http://longlivemusic.blogspot.com
Check out the new CakePHP Questions site http://cakeqs.org and help others with their CakePHP related questions.
You received this message because you are subscribed to the Google Groups "CakePHP" group.
To post to this group, send email to cake-php@googlegroups.com
To unsubscribe from this group, send email to
cake-php+unsubscribe@googlegroups.com For more options, visit this group at http://groups.google.com/group/cake-php?hl=en
No comments:
Post a Comment