Love Fuel?    Donate

FuelPHP Forums

Ask your question about FuelPHP in the appropriate forum, or help others by answering their questions.
Unittesting and database
  • Hi, 

    are there any best practices or built-in functionality in FuelPhp to write Unittests with ORM and DB?

    The workflow would be simple:
    1) Run tests against db
    2) Rollback after every test

    Thanks.

    -at


     
  • HarroHarro
    Accepted Answer
    I currently use the PHPUnit class methods setUp() and tearDown() for that.

    Create and add test data in the setup, and drop the table in the teardown. Unit tests run in the 'test' environment, so you can give it its own db.php defining a test database to use.

Howdy, Stranger!

It looks like you're new here. If you want to get involved, click one of these buttons!

In this Discussion