testing - Autoloading in Laravel Tests -
i'm trying start writing tests within laravel. think practice write own basic testcase, runs test setup (for example migrations).
<?php class testcase extends phpunit_framework_testcase { public function setup() { parent::setup(); // example: db::table('categories')->first(); } } after that, want inherit testcases 1 created above
<?php class testexample extends testcase { public function testsomethingistrue() { $this->asserttrue(true); } } so have 3 problems:
my testcase throws error, class db not found. why heck test not autoloading laravel framework classes?
phpunit tells me (with warning) testcase not contain tests, suspected behaviour class, how can avoid message?
my testexample cannot find class testcase.
can me understanding that?! how can configure test specific autoloading?
update: answer 1: because run tests in netbeans ide, needs configured! setting right phpunit.xml helped
as revealed in our discussion, when run phpunit tests using ide (netbeans, phpstrom , so), have make sure ide correctly configured catch phpunit.xml.
Comments
Post a Comment