Skip to content

Commit

Permalink
Resolving the instance
Browse files Browse the repository at this point in the history
  • Loading branch information
KennedyTedesco committed Sep 25, 2016
1 parent 3b89d53 commit 6219249
Show file tree
Hide file tree
Showing 2 changed files with 20 additions and 1 deletion.
2 changes: 1 addition & 1 deletion src/Illuminate/Console/Scheduling/Schedule.php
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ public function call($callback, array $parameters = [])
public function command($command, array $parameters = [])
{
if (class_exists($command)) {
$command = (new $command)->getName();
$command = app($command)->getName();
}

$binary = ProcessUtils::escapeArgument((new PhpExecutableFinder)->find(false));
Expand Down
19 changes: 19 additions & 0 deletions tests/Console/ConsoleEventSchedulerTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,26 @@ public function testCreateNewArtisanCommandUsingCommandClass()
}
}

class FooClassStub
{
protected $schedule;

public function __construct(Schedule $schedule)
{
$this->schedule = $schedule;
}
}

class ConsoleCommandStub extends Illuminate\Console\Command
{
protected $signature = 'foo:bar';

protected $foo;

public function __construct(FooClassStub $foo)
{
parent::__construct();

$this->foo = $foo;
}
}

0 comments on commit 6219249

Please sign in to comment.