Completed
Push — master ( 0bf679...0df0ec )
by AJ
11:39
created

ShopifyInstallShellTest::tearDown()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 5
Code Lines 3

Duplication

Lines 0
Ratio 0 %

Importance

Changes 1
Bugs 0 Features 0
Metric Value
c 1
b 0
f 0
dl 0
loc 5
rs 9.4285
cc 1
eloc 3
nc 1
nop 0
1
<?php
2
/**
3
 * CakePHPify : CakePHP Plugin for Shopify API Authentication
4
 * Copyright (c) Multidimension.al (http://multidimension.al)
5
 * Github : https://github.com/multidimension-al/cakephpify
6
 *
7
 * Licensed under The MIT License
8
 * For full copyright and license information, please see the LICENSE file
9
 * Redistributions of files must retain the above copyright notice.
10
 *
11
 * @copyright (c) Multidimension.al (http://multidimension.al)
12
 * @link      https://github.com/multidimension-al/cakephpify CakePHPify Github
13
 * @license   http://www.opensource.org/licenses/mit-license.php MIT License
14
 */
15
16
namespace Multidimensional\Cakephpify\Test\TestCase\Shell;
17
18
use Cake\Console\ConsoleIo;
19
use Cake\TestSuite\Stub\ConsoleOutput;
20
use Cake\TestSuite\TestCase;
21
use Multidimensional\Cakephpify\Shell\ShopifyInstallShell;
22
use Symfony\Component\Console\Output\NullOutput;
23
24
class ShopifyInstallShellTest extends TestCase
25
{
26
27
    public function setUp()
0 ignored issues
show
introduced by
Missing function doc comment
Loading history...
28
    {
29
        parent::setUp();
30
        
31
		$this->out = new ConsoleOutput();
0 ignored issues
show
Bug introduced by
The property out does not exist. Did you maybe forget to declare it?

In PHP it is possible to write to properties without declaring them. For example, the following is perfectly valid PHP code:

class MyClass { }

$x = new MyClass();
$x->foo = true;

Generally, it is a good practice to explictly declare properties to avoid accidental typos and provide IDE auto-completion:

class MyClass {
    public $foo;
}

$x = new MyClass();
$x->foo = true;
Loading history...
32
        $io = new ConsoleIo($this->out);
0 ignored issues
show
Comprehensibility introduced by
Avoid variables with short names like $io. Configured minimum length is 3.

Short variable names may make your code harder to understand. Variable names should be self-descriptive. This check looks for variable names who are shorter than a configured minimum.

Loading history...
33
        $this->Shell = $this->getMockBuilder('ShopifyInstallShell')
0 ignored issues
show
Bug introduced by
The property Shell does not exist. Did you maybe forget to declare it?

In PHP it is possible to write to properties without declaring them. For example, the following is perfectly valid PHP code:

class MyClass { }

$x = new MyClass();
$x->foo = true;

Generally, it is a good practice to explictly declare properties to avoid accidental typos and provide IDE auto-completion:

class MyClass {
    public $foo;
}

$x = new MyClass();
$x->foo = true;
Loading history...
34
            ->setMethods(['in', 'err', '_stop', 'clear'])
35
            ->setConstructorArgs([$io])
36
            ->getMock();			
0 ignored issues
show
introduced by
Double space found
Loading history...
37
	}
38
    
39
    public function tearDown()
0 ignored issues
show
introduced by
Missing function doc comment
Loading history...
40
    {
41
        parent::tearDown();
42
        unset($this->shell);
43
    }
44
    
45
    public function testMain()
0 ignored issues
show
introduced by
Missing function doc comment
Loading history...
46
    {
47
        $this->markTestIncomplete('Not implemented yet.'); 
48
		/*$this->Shell->main();
0 ignored issues
show
Unused Code Comprehensibility introduced by
62% of this comment could be valid code. Did you maybe forget this after debugging?

Sometimes obsolete code just ends up commented out instead of removed. In this case it is better to remove the code once you have checked you do not need it.

The code might also have been commented out for debugging purposes. In this case it is vital that someone uncomments it again or your project may behave in very unexpected ways in production.

This check looks for comments that seem to be mostly valid code and reports them.

Loading history...
49
        $output = $this->out->messages();
50
		$expected = "/(.*)/";
51
        $this->assertRegExp($expected, $output);
52
		*/
53
    }
54
}
55