Take the 2-minute tour ×
Stack Overflow is a question and answer site for professional and enthusiast programmers. It's 100% free, no registration required.

I've got an application developed in kohana 3.2. I want to write some functional tests that will affect database content. I would like to load the database from a dump file each time I run all functional test suite (so that I'm sure I can write and remove from the database as much as I want).

How can I do that in Kohana? Does it support functional testing anyhow?

share|improve this question
2  
I love it when people downvote a question without any comments... –  tkoomzaaskz Jun 14 '13 at 15:02

2 Answers 2

I use Codeception for all of my acceptance test, functional tests, and unit tests which is powered by PHPUnit. It is the best testing framework that I have found for PHP. You can pre-load sql dumps prior to functional tests and query directly against the database. It also integrates easily with Selenium for testing browsers.

I released a vagrant development environment with an empty checkout of Kohana 3.3.1 if you want to try it out Codeception. The tests are incredibly easy to write.

Intro to Vagrant with Kohana and Zen Kommerce

Codeception

share|improve this answer

Kohana supports unit testing with the unit test module and php unit installed. It sounds like you may be possibly want to do unit testing with mock objects. You could also set up your database using your models or a dump file too. Full functional testing is possible as well. A good place to start is enable the testing module and then start here...

https://github.com/kohana/unittest/tree/3.2/master/guide

And phpunit here...

https://github.com/sebastianbergmann/phpunit/

share|improve this answer

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.