Skip to content

Commit 4fef311

Browse files
committed
Merge pull request #22 from loadsys/f/add-tests
F/add tests
2 parents 78c0a23 + cbce40a commit 4fef311

7 files changed

Lines changed: 422 additions & 9 deletions

File tree

.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,3 +5,4 @@ app/tmp/*
55
app/[Cc]onfig/core.php
66
app/[Cc]onfig/database.php
77
!empty
8+
/vendor/*

composer.json

Lines changed: 9 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -20,18 +20,24 @@
2020
"source": "https://github.com/loadsys/CakePHP-ConfigReadShell"
2121
},
2222
"require": {
23-
"php": ">=5.4.19",
23+
"php": ">=5.4",
24+
"cakephp/cakephp": "~3.0",
2425
"composer/installers": "~1.0"
2526
},
27+
"require-dev": {
28+
"phpunit/phpunit": "~4.1",
29+
"squizlabs/php_codesniffer": "~2.0",
30+
"satooshi/php-coveralls": "dev-master"
31+
},
2632
"autoload": {
2733
"psr-4": {
2834
"ConfigRead\\": "src"
2935
}
3036
},
3137
"autoload-dev": {
3238
"psr-4": {
33-
"ConfigRead\\Test\\": "tests",
34-
"Cake\\Test\\": "vendor/cakephp/cakephp/test"
39+
"Cake\\Test\\": "vendor/cakephp/cakephp/test",
40+
"ConfigRead\\Test\\": "tests"
3541
}
3642
}
3743
}

phpunit.xml.dist

Lines changed: 29 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,29 @@
1+
<?xml version="1.0" encoding="UTF-8"?>
2+
<phpunit
3+
backupGlobals="false"
4+
backupStaticAttributes="false"
5+
colors="true"
6+
processIsolation="false"
7+
stopOnFailure="false"
8+
syntaxCheck="false"
9+
bootstrap="./tests/bootstrap.php"
10+
>
11+
12+
<testsuites>
13+
<testsuite name="ConfigReadShell Test Suite">
14+
<directory>./tests/TestCase</directory>
15+
</testsuite>
16+
</testsuites>
17+
18+
<!-- Prevent coverage reports from looking in tests and vendors -->
19+
<filter>
20+
<blacklist>
21+
<directory suffix=".php">./vendor/</directory>
22+
<directory suffix=".ctp">./vendor/</directory>
23+
24+
<directory suffix=".php">./tests/</directory>
25+
<directory suffix=".ctp">./tests/</directory>
26+
</blacklist>
27+
</filter>
28+
29+
</phpunit>

src/Shell/ConfigReadShell.php

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
/**
33
* ConfigReadShell
44
*
5-
* @package App.Console.Command
5+
* @package ConfigRead\Shell
66
*/
77
namespace ConfigRead\Shell;
88

@@ -49,8 +49,6 @@ public function _welcome() {
4949
public function startup() {
5050
parent::startup();
5151

52-
Configure::write('debug', 0);
53-
5452
if (isset($this->params['h'])) {
5553
return $this->help();
5654
}
@@ -147,7 +145,7 @@ protected function printVal($key, $val) {
147145

148146
if ($this->formatBash) {
149147
$key = strtoupper(str_replace('.', '_', $key));
150-
$format = ($this->formatBash ? '%1$s=%2$s' : '%2$s');
148+
$format = '%1$s=%2$s';
151149
}
152150

153151
$this->out(sprintf($format, $key, $val));
@@ -160,6 +158,7 @@ protected function printVal($key, $val) {
160158
*
161159
* @access public
162160
* @return void
161+
* @codeCoverageIgnore
163162
*/
164163
public function getOptionParser() {
165164
$parser = parent::getOptionParser();

tests/Case/Shell/ConfigReadShellTest.php

Lines changed: 0 additions & 2 deletions
This file was deleted.

0 commit comments

Comments
 (0)