laravel 4 unit test

1.install PHPUnit, add the following line to your composer.json file

{
  "require": {
    "laravel/framework": "4.1.*",
    "phpunit/phpunit": "3.7.*"
  }
}

2.run the composer update command to install the package:

composer update

3.Now that you have PHPUnit installed, you can run automated tests from the command line. Laravel comes with one example test already set up. To make sure you have PHPUnit correctly set up, run the following command from Terminal and check vender/bin/phpunit is appear:

phpunit

4.You should get the following line returned if everything went ok:

OK (1 test, 2 assertions)

reference http://culttt.com/2013/05/20/getting-started-with-testing-laravel-4-models/

Related posts:

This entry was posted in laravel4. Bookmark the permalink.