Skip to content

Commit

Permalink
add a single test, add php_cs configuration
Browse files Browse the repository at this point in the history
  • Loading branch information
wesnick committed May 12, 2017
1 parent 6603132 commit 7373686
Show file tree
Hide file tree
Showing 13 changed files with 1,486 additions and 219 deletions.
4 changes: 3 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
/vendor/
/build/
*.phar
*.phar
.php_cs.cache
.php_cs
43 changes: 43 additions & 0 deletions .php_cs.dist
Original file line number Diff line number Diff line change
@@ -0,0 +1,43 @@
<?php

$header = <<<'EOF'
This software is licensed under MIT License.
Copyright (c) 2012, Kazuyuki Hayashi
EOF;

return PhpCsFixer\Config::create()
->setRiskyAllowed(true)
->setRules([
'@Symfony' => true,
'@Symfony:risky' => true,
'array_syntax' => ['syntax' => 'short'],
'binary_operator_spaces' => ['align_double_arrow' => true, 'align_equals' => true],
'combine_consecutive_unsets' => true,
// one should use PHPUnit methods to set up expected exception instead of annotations
'general_phpdoc_annotation_remove' => ['expectedException', 'expectedExceptionMessage', 'expectedExceptionMessageRegExp'],
'header_comment' => ['header' => $header],
'heredoc_to_nowdoc' => true,
'list_syntax' => ['syntax' => 'long'],
'no_extra_consecutive_blank_lines' => ['break', 'continue', 'extra', 'return', 'throw', 'use', 'parenthesis_brace_block', 'square_brace_block', 'curly_brace_block'],
'no_short_echo_tag' => true,
'no_unreachable_default_argument_value' => true,
'no_useless_else' => true,
'no_useless_return' => true,
'ordered_class_elements' => true,
'ordered_imports' => true,
'php_unit_strict' => true,
'php_unit_test_class_requires_covers' => true,
'phpdoc_add_missing_param_annotation' => true,
'phpdoc_order' => true,
'semicolon_after_instruction' => true,
'strict_comparison' => true,
'strict_param' => true,
])
->setFinder(
PhpCsFixer\Finder::create()
->exclude('tests/Fixtures')
->exclude('vendor')
->in(__DIR__)
)
;
14 changes: 14 additions & 0 deletions composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,21 @@
"require": {
"php": ">=5.6"
},
"require-dev": {
"phpunit/phpunit": "~4.8"
},
"autoload": {
"psr-0": { "": "src/" }
},
"autoload-dev": {
"psr-4": {
"KzykHys\\ClassGenerator\\Tests\\": "tests/"
}
},
"scripts": {
"test": "vendor/bin/phpunit --testsuite unit && vendor/bin/phpunit --testsuite functional",
"test-all": "vendor/bin/phpunit --testsuite all",
"test-integration": "vendor/bin/phpunit --testsuite integration",
"test-coverage": "vendor/bin/phpunit --testsuite all --coverage-text --coverage-clover=build/coverage.xml"
}
}
Loading

0 comments on commit 7373686

Please sign in to comment.