Skip to content

Commit 998293a

Browse files
committed
Use CS for tests folder - Close #18
1 parent a4ba8b8 commit 998293a

20 files changed

+130
-28
lines changed

.php_cs

Lines changed: 14 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,21 @@
11
<?php
22

3+
/**
4+
* @see https://github.com/open-code-modeling/php-code-ast for the canonical source repository
5+
* @copyright https://github.com/open-code-modeling/php-code-ast/blob/master/COPYRIGHT.md
6+
* @license https://github.com/open-code-modeling/php-code-ast/blob/master/LICENSE.md MIT License
7+
*/
8+
9+
declare(strict_types=1);
10+
311
$config = new Prooph\CS\Config\Prooph();
4-
$config->getFinder()->in(__DIR__);
12+
$finder = $config->getFinder();
13+
14+
$finder->exclude('vendor');
15+
$finder->in(__DIR__);
16+
$finder->append(['.php_cs']);
517

6-
$cacheDir = getenv('TRAVIS') ? getenv('HOME') . '/.php-cs-fixer' : __DIR__;
18+
$cacheDir = \getenv('TRAVIS') ? \getenv('HOME') . '/.php-cs-fixer' : __DIR__;
719

820
$config->setCacheFile($cacheDir . '/.php_cs.cache');
921

composer.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -46,8 +46,8 @@
4646
"@analyse"
4747
],
4848
"docheader": "vendor/bin/docheader check src/ tests/",
49-
"cs": "php-cs-fixer fix src -v --diff --dry-run",
50-
"cs-fix": "php-cs-fixer fix src -v --diff",
49+
"cs": "php-cs-fixer fix -v --diff --dry-run",
50+
"cs-fix": "php-cs-fixer fix -v --diff",
5151
"test": "vendor/bin/phpunit",
5252
"analyse": "php vendor/bin/phpstan.phar analyse --no-interaction"
5353
},

tests/Builder/ClassBuilderTest.php

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,17 @@
11
<?php
22

3+
/**
4+
* @see https://github.com/open-code-modeling/php-code-ast for the canonical source repository
5+
* @copyright https://github.com/open-code-modeling/php-code-ast/blob/master/COPYRIGHT.md
6+
* @license https://github.com/open-code-modeling/php-code-ast/blob/master/LICENSE.md MIT License
7+
*/
8+
39
declare(strict_types=1);
410

511
namespace OpenCodeModelingTest\CodeAst\Builder;
612

7-
use OpenCodeModeling\CodeAst\Builder\ClassConstBuilder;
813
use OpenCodeModeling\CodeAst\Builder\ClassBuilder;
14+
use OpenCodeModeling\CodeAst\Builder\ClassConstBuilder;
915
use PhpParser\NodeTraverser;
1016
use PhpParser\Parser;
1117
use PhpParser\ParserFactory;

tests/Builder/ClassMethodBuilderTest.php

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,11 @@
11
<?php
22

3+
/**
4+
* @see https://github.com/open-code-modeling/php-code-ast for the canonical source repository
5+
* @copyright https://github.com/open-code-modeling/php-code-ast/blob/master/COPYRIGHT.md
6+
* @license https://github.com/open-code-modeling/php-code-ast/blob/master/LICENSE.md MIT License
7+
*/
8+
39
declare(strict_types=1);
410

511
namespace OpenCodeModelingTest\CodeAst\Builder;

tests/Builder/ClassPropertyBuilderTest.php

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,11 @@
11
<?php
22

3+
/**
4+
* @see https://github.com/open-code-modeling/php-code-ast for the canonical source repository
5+
* @copyright https://github.com/open-code-modeling/php-code-ast/blob/master/COPYRIGHT.md
6+
* @license https://github.com/open-code-modeling/php-code-ast/blob/master/LICENSE.md MIT License
7+
*/
8+
39
declare(strict_types=1);
410

511
namespace OpenCodeModelingTest\CodeAst\Builder;

tests/Builder/InterfaceBuilderTest.php

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,11 @@
11
<?php
22

3+
/**
4+
* @see https://github.com/open-code-modeling/php-code-ast for the canonical source repository
5+
* @copyright https://github.com/open-code-modeling/php-code-ast/blob/master/COPYRIGHT.md
6+
* @license https://github.com/open-code-modeling/php-code-ast/blob/master/LICENSE.md MIT License
7+
*/
8+
39
declare(strict_types=1);
410

511
namespace OpenCodeModelingTest\CodeAst\Builder;

tests/Code/InterfaceGeneratorTest.php

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,11 @@
11
<?php
22

3+
/**
4+
* @see https://github.com/open-code-modeling/php-code-ast for the canonical source repository
5+
* @copyright https://github.com/open-code-modeling/php-code-ast/blob/master/COPYRIGHT.md
6+
* @license https://github.com/open-code-modeling/php-code-ast/blob/master/LICENSE.md MIT License
7+
*/
8+
39
declare(strict_types=1);
410

511
namespace OpenCodeModelingTest\CodeAst\Code;

tests/Code/MethodGeneratorTest.php

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,11 @@
11
<?php
22

3+
/**
4+
* @see https://github.com/open-code-modeling/php-code-ast for the canonical source repository
5+
* @copyright https://github.com/open-code-modeling/php-code-ast/blob/master/COPYRIGHT.md
6+
* @license https://github.com/open-code-modeling/php-code-ast/blob/master/LICENSE.md MIT License
7+
*/
8+
39
declare(strict_types=1);
410

511
namespace OpenCodeModelingTest\CodeAst\Code;
@@ -227,7 +233,6 @@ public function it_generates_method_with_long_doc_block(): void
227233
its layout.
228234
EOF;
229235

230-
231236
$method = new MethodGenerator(
232237
'setType',
233238
[

tests/Code/ParameterGeneratorTest.php

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,11 @@
11
<?php
22

3+
/**
4+
* @see https://github.com/open-code-modeling/php-code-ast for the canonical source repository
5+
* @copyright https://github.com/open-code-modeling/php-code-ast/blob/master/COPYRIGHT.md
6+
* @license https://github.com/open-code-modeling/php-code-ast/blob/master/LICENSE.md MIT License
7+
*/
8+
39
declare(strict_types=1);
410

511
namespace OpenCodeModelingTest\CodeAst\Code;

tests/Code/PropertyGeneratorTest.php

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,11 @@
11
<?php
22

3+
/**
4+
* @see https://github.com/open-code-modeling/php-code-ast for the canonical source repository
5+
* @copyright https://github.com/open-code-modeling/php-code-ast/blob/master/COPYRIGHT.md
6+
* @license https://github.com/open-code-modeling/php-code-ast/blob/master/LICENSE.md MIT License
7+
*/
8+
39
declare(strict_types=1);
410

511
namespace OpenCodeModelingTest\CodeAst\Code;
@@ -107,7 +113,6 @@ public function it_generates_property_with_long_doc_block(): void
107113
its layout.
108114
EOF;
109115

110-
111116
$property = new PropertyGenerator('sourceFolder', 'string');
112117
$property->setDocBlockComment($docBlockComment);
113118

0 commit comments

Comments
 (0)