[symfony-users] Re: combining functional and unit tests?

2010-06-02 Thread Massimiliano Arione
You can simply use propel tester. See
http://www.symfony-project.org/jobeet/1_4/Propel/en/11#chapter_11_the_propel_tester

cheers
Massimiliano

On 2 Giu, 00:18, Jeremy Thomerson  wrote:
> I have written a functional test that tests my site's registration flow.  At
> the end of the test, I am calling my account peer and using lime to test
> that the account that was just registered is all in the database correctly.
>  The test runs great if I run it by itself ("test:functional frontend
> registrationActions"), but it gives me an error if I run all functional
> tests together ("test:functional frontend").  It doesn't like the additional
> tests that I am doing with just lime.

-- 
If you want to report a vulnerability issue on symfony, please send it to 
security at symfony-project.com

You received this message because you are subscribed to the Google
Groups "symfony users" group.
To post to this group, send email to symfony-users@googlegroups.com
To unsubscribe from this group, send email to
symfony-users+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/symfony-users?hl=en


[symfony-users] Re: combining functional and unit tests?

2010-06-01 Thread Jeremy Thomerson
Never mind - I think I figured it out.
Instead of creating a new lime test like I was doing:
$t = new lime_test(11, new lime_output_color());

I should continue using the test that the functional test was using:
$t = $browser->test();

Best regards,
Jeremy Thomerson

On Tue, Jun 1, 2010 at 5:18 PM, Jeremy Thomerson  wrote:

> I have written a functional test that tests my site's registration flow.
>  At the end of the test, I am calling my account peer and using lime to test
> that the account that was just registered is all in the database correctly.
>  The test runs great if I run it by itself ("test:functional frontend
> registrationActions"), but it gives me an error if I run all functional
> tests together ("test:functional frontend").  It doesn't like the additional
> tests that I am doing with just lime.
>
> Here's the error I get when running all functional tests together:
> registrationActionsTest...#
> Looks like you planned 21 test but ran 11 extra.
>
> registrationActionsTest..dubious
>
> But running it by itself, I get this (I have 21 functional tests and 11
> lime tests):
> ok 11 - cc type matches
>  Looks like everything went fine.
> 1..21
>  Looks like everything went fine.
>
> What's the correct way of doing this?
>
> Here's what I'm currently doing:
>  include(dirname(__FILE__).'/../../bootstrap/functional.php');
> $browser = new MyCompanyFunctionalTest(new sfBrowser());
>
> $browser
> ->goToHomepage()
>  // do some other tests (21 total)
>
> ->with('response')->begin()
>  ->isRedirected()
>  ->followRedirect()
>  ->end()
>  ->testThisIsHomepage('/Your account has been created/')
> ;
>
> // now do the testing directly from the db:
> $t = new lime_test(11, new lime_output_color());
> $user = UserPeer::findByUsername($username);
> $acct = $user->getAccount();
>
> $t->is($user->getUsername(), $expectedUsername, 'username matches');
> // do some more tests
> $t->is($acct->getCreditCard()->getType(), 'MC', 'cc type matches');
>
> Thanks in advance!
>
> Jeremy Thomerson
>

-- 
If you want to report a vulnerability issue on symfony, please send it to 
security at symfony-project.com

You received this message because you are subscribed to the Google
Groups "symfony users" group.
To post to this group, send email to symfony-users@googlegroups.com
To unsubscribe from this group, send email to
symfony-users+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/symfony-users?hl=en