Laravel framework classes not available in PHPUnit data provider

前端 未结 3 996
忘掉有多难
忘掉有多难 2020-12-31 05:59

I have something like the following set up in Laravel:

In /app/controllers/MyController.php:

class MyController extends         


        
3条回答
  •  盖世英雄少女心
    2020-12-31 06:04

    The test will initialize much faster if you create the application right within the dataProvider method, especially if you have large set of items to test.

    public function myDataProvider() {
        $this->createApplication();
    
        return [
            [ MyController::MAX_FILE_SIZE ]
        ];
    }
    

提交回复
热议问题