Yii Framework Forum: CUploadedFile more testfriendly? - Yii Framework Forum

Jump to content

Page 1 of 1
  • You cannot start a new topic
  • You cannot reply to this topic

CUploadedFile more testfriendly? Rate Topic: -----

#1 User is offline   Blizz 

  • Junior Member
  • Pip
  • Yii
  • Group: Members
  • Posts: 22
  • Joined: 14-March 10

  Posted 07 April 2010 - 01:41 AM

Uploading files is pretty important for my project, and although most companies avoid testing it like something with a really bad smell, I took a stab at it.

Unfortunately it is impossible right now to clear the CUploadedFile::$_files-property between test runs, forcing me to switch to process isolation for testing. This obviously increases the test time by a factor 10.

So the question is, as the topic states, is it possible to make CUploadedFile (and imho all components that have a private static that is only initialized once) more unit test friendly?
0

#2 User is offline   samdark 

  • Having fun
  • Yii
  • Group: Yii Dev Team
  • Posts: 2,641
  • Joined: 17-January 09
  • Location:Russia

Posted 07 April 2010 - 04:31 AM

Please create a ticket with your suggestions and possible solutions: http://code.google.c...ii/issues/list. It will help us to decide about it faster.
0

#3 User is offline   szako 

  • Junior Member
  • Pip
  • Yii
  • Group: Members
  • Posts: 56
  • Joined: 17-May 10

Posted 17 January 2011 - 04:18 PM

I found this thread because I ran into the same problem. (Not many threads with the topic file upload testing)

So I was scratching my head how the hell to solve this, then I opened the CUploadedFile.php and looked into it.
There is a reset() method which can be called statically (from 1.1.4).

This is for the other searchers.
-------------
m(o_O)m
0

Share this topic:


Page 1 of 1
  • You cannot start a new topic
  • You cannot reply to this topic

1 User(s) are reading this topic
0 members, 1 guests, 0 anonymous users