Dynamic data in fixtures
Hello all,
today I started with unit testing with SimpleTest and ran into a
problem. In some model i have a method 'findToday', which finds
records where 'day' is set to today's date. It's is a very simple
function which works but to become familiar with unit testing I wrote
a test en a fixture for it. While writing the fixture I realized that
the 'day' field had to be dynamic for the tests to succeed so i made a
variable $today which contains todays date date('Y/m/d'). This
variable I put in the fixed data.
I ran the test and it gave me an error:
'Parse error: syntax error, unexpected '(', expecting ',' or ';'
in ........ on line 18'
I ran in to some information which said that fixture data is really
fixed, so there can't be any dynamic data in it.
How should I fix this problem? I don't want to update my fixtures
every time I want to test my function.
Greetz Jacob
Check out the new CakePHP Questions site http://cakeqs.org and help others with their CakePHP related questions.
You received this message because you are subscribed to the Google Groups "CakePHP" group.
To post to this group, send email to cake-php@googlegroups.com
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?hl=en
0 Comments:
Post a Comment
Subscribe to Post Comments [Atom]
<< Home