Completed
Pull Request — laravel-5 (#63)
by
unknown
10:10
created

RefreshCommandTest::tearDown()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 6

Duplication

Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
dl 0
loc 6
rs 10
c 0
b 0
f 0
cc 1
nc 1
nop 0
1
<?php
2
3
use Mockery as m;
4
use JsLocalization\Console\RefreshCommand;
5
6
class RefreshCommandTest extends TestCase
0 ignored issues
show
Bug introduced by
There is at least one abstract method in this class. Maybe declare it as abstract, or implement the remaining methods: artisan, be, call, seed
Loading history...
7
{
8
    public function tearDown(): void
9
    {
10
        m::close();
11
12
        parent::tearDown();
13
    }
14
15
    public function testNoLocalesConfigException()
16
    {
17
        // Mock Config
18
        Illuminate\Support\Facades\Config::swap($config = m::mock('ConfigMock'));
19
20
        $config->shouldReceive('get')->with('js-localization.locales')
21
          ->andReturn(null);
22
23
        $this->expectException(Exception::class);
24
25
        $this->runCommand();
26
    }
27
28
    protected function runCommand()
29
    {
30
        $cmd = new RefreshCommand();
31
32
        $cmd->setLaravel(resolve(\Illuminate\Contracts\Foundation\Application::class));
33
34
        $cmd->run(
35
            new Symfony\Component\Console\Input\ArrayInput([]),
36
            new Symfony\Component\Console\Output\NullOutput
37
        );
38
    }
39
40
}
41