Validating Zend Form though data are filled programmatically



I'm using this code to check if a form is valid, but I'm actually getting the data from a curl call, so the second if test doesn't validate. How can I make it validate?

if($this->_request->isPost()){
if($form->isValid($this->_request->getPost())){

}
}

It seems that the second if test $form->isValid() accepts an array, so I tried replacing $this->_request->getPost() with an array that I created myself to hold form parameters. I got the test and test2 parameters from the curl request, and got the hash from the form itself, but still $form->isValid() doesn't validate with the array.

$array = array('test'=>'testvalue', 'test2'=>'test2value', 'hash'=>'form hash');
if($form->isValid($array)){

}

So since I'm getting all my data from a curl call, how can I still populate the form and get it to validate?