Monday, December 12, 2011

Re: Testing image upload

On Mon, Dec 12, 2011 at 4:46 AM, leigh <phpnotepad@gmail.com> wrote:
> Hi Matteo,
>
> Wrap move_uploaded_file and is_uploaded_file inside the controller
>
> function moveUploadedFIle($filename, $destination) {
>  return move_uploaded_file($filename, $destination);
> }
>
> function moveUploadedFIle($filename, $destination) {
>  return is_uploaded_file($filename, $destination);
> }
>
> Then inside your testController override them.
>
> class TestPostsController extends postsController {
>
>  protected function isUploadedFile($filename) {
>   return true;
>  }
>  protected function moveUploadedFile($filename, $destination) {
>   return true;
>  }
>

You are assuming that my controllers tests extend controllers and not,
as usual, CakeControllerTest. However, do I really need to do
something similar to test image uploading? Is this supported or not?


Matteo

--
http://www.matteolandi.net/

--
Our newest site for the community: CakePHP Video Tutorials http://tv.cakephp.org
Check out the new CakePHP Questions site http://ask.cakephp.org and help others with their CakePHP related questions.


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

0 Comments:

Post a Comment

Subscribe to Post Comments [Atom]

<< Home


Real Estate