Example #1
0
 public function post($name = NULL)
 {
     $post = Tart_Request::post($this->request->post(), $_FILES);
     if ($name !== NULL) {
         return Arr::get($post, $name);
     }
     return $post;
 }
Example #2
0
 public function test_post()
 {
     $files = array('images' => array('name' => array('0' => array('file' => 'test1.jpg')), 'type' => array('0' => array('file' => 'image/jpeg')), 'tmp_name' => array('0' => array('file' => '/tmp/n1l54Gs')), 'error' => array('0' => array('file' => '0')), 'size' => array('0' => array('file' => '1715'))));
     $post = array('images' => array('0' => array('name' => 'My Name')));
     $post = Tart_Request::post($post, $files);
     $expected = array('images' => array('0' => array('file' => array('name' => 'test1.jpg', 'type' => 'image/jpeg', 'tmp_name' => '/tmp/n1l54Gs', 'error' => '0', 'size' => '1715'), 'name' => 'My Name')));
     $this->assertEquals($expected, $post);
 }