Thursday, April 26, 2012

Re: Mock and test uploads

I would take cues from the Media plugin, which uses binary data in some of its testing library.


There are even more tests and data in the MM library within the plugin: https://github.com/davidpersson/media/tree/next/libs/mm/tests

I don't have any experience with MeioUpload but I imagine changing the paths to the tmp folder will be possible.

I know this isn't a specific answer but it should give you some good jumping off points.

-jeremy

On Thursday, April 26, 2012 7:57:40 AM UTC-7, Thiago Belem wrote:
I'm creating a new MeioUpload/Media behavior and I wanted to make it totally covered by tests...

Do you guys have any idea/recomendation/resource about mocking uploads on CakePHP + PHPUnit?

I know I can't just populate $_FILES with my data and expect is_uploaded_file or move_uploaded_file functions to work.

I don't want to use anoter testing framework like PHPT or something that's not pure CakePHP and PHPUnit.

Regards,
--
Thiago Belem
Desenvolvedor
Rio de Janeiro - RJ - Brasil

Assando Sites - Curso online de CakePHP

--
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

No comments: