RefreshCommandTest   A
last analyzed

Complexity

Total Complexity 4

Size/Duplication

Total Lines 40
Duplicated Lines 0 %

Coupling/Cohesion

Components 0
Dependencies 6

Importance

Changes 0
Metric Value
wmc 4
lcom 0
cbo 6
dl 0
loc 40
rs 10
c 0
b 0
f 0

4 Methods

Rating   Name   Duplication   Size   Complexity  
A setUp() 0 4 1
A tearDown() 0 6 1
A testNoLocalesConfigException() 0 13 1
A runCommand() 0 9 1
1
<?php
2
3
use Mockery as m;
4
use JsLocalization\Console\RefreshCommand;
5
6
class RefreshCommandTest extends TestCase
7
{
8
9
    public function setUp()
10
    {
11
        parent::setUp();
12
    }
13
14
    public function tearDown()
15
    {
16
        m::close();
17
18
        parent::tearDown();
19
    }
20
21
    public function testNoLocalesConfigException()
22
    {
23
        // Mock Config
24
        Illuminate\Support\Facades\Config::swap($config = m::mock('ConfigMock'));
25
26
        $config->shouldReceive('get')->with('js-localization.locales')
27
          ->andReturn(null);
28
29
30
        $this->setExpectedException('Exception');
31
32
        $this->runCommand();
33
    }
34
35
    protected function runCommand()
36
    {
37
        $cmd = new RefreshCommand();
38
39
        $cmd->run(
40
            new Symfony\Component\Console\Input\ArrayInput(['package' => 'foo']),
41
            new Symfony\Component\Console\Output\NullOutput
42
        );
43
    }
44
45
}
46