Framework: Can't use queue's fake method and artisan's call in same test

Created on 17 Apr 2017  路  1Comment  路  Source: laravel/framework

  • Laravel Version: 5.4.19
  • PHP Version: 7.1.3
  • Database Driver & Version: MariaDB 10.1.19

Description:

The problem is - when we use queue's fake method and artisan's call method we gonna end up with this kind of error:

TypeError: Argument 1 passed to IlluminateQueueWorker::__construct() must be an instance of IlluminateQueueQueueManager, instance of IlluminateSupportTestingFakesQueueFake given

Which I believe is issue with Laravel itself. If I'm wrong, please correct me. I found simple workaround for this - I've created seperate unit test for this particular feature, which doesn't include fake method, but I think it's worth to mention this problem there.

Steps To Reproduce:

Simply use this example code:
```php
public function setUp()
{
parent::setUp();

    Queue::fake();
}

public function testExample()
{
    Artisan::call('schedule:run'); // Can be literally any command
}
bug

Most helpful comment

>All comments

Was this page helpful?
0 / 5 - 0 ratings