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

RefreshCommandTest   A

Complexity

Total Complexity 3

Size/Duplication

Total Lines 35
Duplicated Lines 0 %

Coupling/Cohesion

Components 0
Dependencies 7

Importance

Changes 0
Metric Value
wmc 3
lcom 0
cbo 7
dl 0
loc 35
rs 10
c 0
b 0
f 0

3 Methods

Rating   Name   Duplication   Size   Complexity  
A tearDown() 0 6 1
A testNoLocalesConfigException() 0 12 1
A runCommand() 0 11 1
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