|
Posted by Matthew Weier O'Phinney on 06/07/05 21:10
* mbneto <mbneto@gmail.com> :
> Thanks for the reply. Your email confirmed what I've read/thought
> about the tests.
>
> I'll look this SimpleTest even tough PHPUnit2 seems to do the job fine.
Use the unit testing framework with which you are most comfortable; the
ideas remain the same, just the details differ.
> If you have more info (like books, urls, examples) please send me.
Unfortunately, no. Most of this is personal experience, a little of it
was garnered from php|Tropics, and that portion wasn't an official part
of Jason Sweat's presentation.
> On 6/2/05, Matthew Weier O'Phinney <matthew@garden.org> wrote:
> > * mbneto <mbneto@gmail.com> :
> > > I am trying the phpunit2 for unit testing but the examples found in
> > > the documentation are few and do not address, for example, tests when
> > > database access is involved.
> > >
> > > Perhaps this belongs to a more general question (i.e strategies for
> > > unit testing) so any urls, docs would be great.
> >
> > Jason Sweat covered this at php|Tropics, using SimpleTest as the unit
> > testing framework. I use phpt unit tests (developed for testing php
> > itself, and used by the PEAR project for regression tests). The
> > principles are the same regardless of framework, however.
> >
> > The fundamental problem is: your code may depend on the results of a DB
> > operation -- it's primary purpose may even be to perform a DB operation.
> > While you can test the code, you still need to test whether or not your
> > code can successfully perform the DB operation as well. A common problem
> > I find is that I'm building SQL on the fly -- and that process may build
> > shoddy SQL. It may be building exactly what I designed it to do, but the
> > RDBMS will never be able to actually utilize the SQL I build. Tests can
> > help catch these issues.
<snip -- full explanation>
--
Matthew Weier O'Phinney | WEBSITES:
Webmaster and IT Specialist | http://www.garden.org
National Gardening Association | http://www.kidsgardening.com
802-863-5251 x156 | http://nationalgardenmonth.org
mailto:matthew@garden.org | http://vermontbotanical.org
Navigation:
[Reply to this message]
|