1

I understand that Laravel 5 is unfinished, but so far I got around that pretty well.

My question concerns testing. Previously you were able to Artisan::call('migrate') in your test to set up the database.

How should we do this in Laravel 5?

I tried Artisan::call('migrate'), $this->app['artisan']->call('migrate'), including the class via use Illuminate\Support\Facades\Artisan, nothing of which worked.

2
  • Someone in the IRC channel would know. That is the best place to ask since its under active development and Taylor spends time in IRC to answer questions as well. Commented Oct 23, 2014 at 16:23
  • I just asked there and got no response. I'll try again after some time :) Commented Oct 23, 2014 at 16:26

1 Answer 1

2

I found a temporary solution while we wait for better built-in support.

$this->app->make('Illuminate\Contracts\Console\Kernel')->handle(
    new Symfony\Component\Console\Input\StringInput('migrate'),
    new Symfony\Component\Console\Output\NullOutput);
Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.