Skip to content
This repository was archived by the owner on Dec 3, 2019. It is now read-only.

Commit 7cd63a6

Browse files
committed
Ported Pho integration from the main Phony repo.
1 parent 6ab70bc commit 7cd63a6

31 files changed

+2996
-0
lines changed

.gitattributes

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
.gitattributes export-ignore
2+
.gitignore export-ignore
3+
.php_cs export-ignore
4+
.scrutinizer.yml export-ignore
5+
.sensiolabs.yml export-ignore
6+
.travis.yml export-ignore
7+
appveyor.yml export-ignore
8+
/scripts/ export-ignore
9+
/test/ export-ignore

.gitignore

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
/.composer/
2+
/coverage/
3+
/test/bin/php-cs-fixer
4+
/vendor/
5+
/README.html

.php_cs

Lines changed: 77 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,77 @@
1+
<?php
2+
3+
$finder = PhpCsFixer\Finder::create()
4+
->in(__DIR__)
5+
->exclude(array(
6+
'build',
7+
'coverage',
8+
'test/fixture',
9+
'vendor',
10+
'web',
11+
));
12+
13+
return PhpCsFixer\Config::create()
14+
->setRules(array(
15+
'@PSR2' => true,
16+
17+
'array_syntax' => array('syntax' => 'long'),
18+
'binary_operator_spaces' => false,
19+
'blank_line_after_opening_tag' => true,
20+
'blank_line_before_return' => true,
21+
'braces' => false,
22+
'cast_spaces' => true,
23+
'class_definition' => array('singleLine' => false),
24+
'concat_space' => array('spacing' => 'one'),
25+
'declare_equal_normalize' => true,
26+
'function_typehint_space' => true,
27+
'hash_to_slash_comment' => true,
28+
'heredoc_to_nowdoc' => true,
29+
'include' => true,
30+
'linebreak_after_opening_tag' => true,
31+
'lowercase_cast' => true,
32+
'method_separation' => true,
33+
'native_function_casing' => true,
34+
'new_with_braces' => true,
35+
'no_blank_lines_after_class_opening' => true,
36+
'no_blank_lines_after_phpdoc' => true,
37+
'no_empty_comment' => true,
38+
'no_empty_phpdoc' => true,
39+
'no_empty_statement' => true,
40+
'no_extra_consecutive_blank_lines' => true,
41+
'no_leading_import_slash' => true,
42+
'no_leading_namespace_whitespace' => true,
43+
'no_mixed_echo_print' => true,
44+
'no_multiline_whitespace_before_semicolons' => true,
45+
'no_short_bool_cast' => true,
46+
'no_singleline_whitespace_before_semicolons' => true,
47+
'no_spaces_around_offset' => true,
48+
'no_trailing_comma_in_singleline_array' => true,
49+
'no_unneeded_control_parentheses' => true,
50+
'no_unused_imports' => true,
51+
'no_whitespace_before_comma_in_array' => true,
52+
'no_whitespace_in_blank_line' => true,
53+
'normalize_index_brace' => true,
54+
'object_operator_without_whitespace' => true,
55+
'ordered_imports' => true,
56+
'phpdoc_align' => true,
57+
'phpdoc_indent' => true,
58+
'phpdoc_no_package' => true,
59+
'phpdoc_scalar' => true,
60+
'phpdoc_to_comment' => true,
61+
'phpdoc_trim' => true,
62+
'phpdoc_types' => true,
63+
'pre_increment' => true,
64+
'return_type_declaration' => true,
65+
'self_accessor' => true,
66+
'short_scalar_cast' => true,
67+
'single_blank_line_before_namespace' => true,
68+
'single_quote' => true,
69+
'space_after_semicolon' => true,
70+
'standardize_not_equals' => true,
71+
'ternary_operator_spaces' => true,
72+
'trailing_comma_in_multiline_array' => true,
73+
'trim_array_spaces' => true,
74+
'unary_operator_spaces' => true,
75+
'whitespace_after_comma_in_array' => true,
76+
))
77+
->setFinder($finder);

.scrutinizer.yml

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
filter:
2+
paths:
3+
- "src/"

.sensiolabs.yml

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
rules:
2+
php.object_parameter_not_type_hinted:
3+
enabled: false # deliberate to squeeze out more performance, however slight
4+
php.bad_mutator_method_name_for_boolean_property:
5+
enabled: false # code style disagreement
6+
php.interface_has_no_interface_suffix:
7+
enabled: false # code style disagreement

.travis.yml

Lines changed: 61 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,61 @@
1+
language: php
2+
3+
matrix:
4+
include:
5+
- php: 5.4
6+
- php: 5.5
7+
- php: 5.6
8+
- php: 7.0
9+
- php: 7.1
10+
- php: nightly
11+
- php: hhvm-3.6
12+
sudo: required
13+
dist: trusty
14+
group: edge
15+
- php: hhvm-3.9
16+
sudo: required
17+
dist: trusty
18+
group: edge
19+
- php: hhvm-3.12
20+
sudo: required
21+
dist: trusty
22+
group: edge
23+
- php: hhvm-3.15
24+
sudo: required
25+
dist: trusty
26+
group: edge
27+
- php: hhvm-3.15
28+
sudo: required
29+
dist: trusty
30+
group: edge
31+
env: HHVMPHP7=1
32+
- php: hhvm-nightly
33+
sudo: required
34+
dist: trusty
35+
group: edge
36+
fast_finish: true
37+
allow_failures:
38+
- php: nightly
39+
- php: hhvm-nightly
40+
- env: HHVMPHP7=1
41+
42+
before_install:
43+
- phpenv config-rm xdebug.ini || true
44+
- composer config --global github-oauth.github.com $GITHUB_TOKEN
45+
install: composer install --prefer-dist --no-progress --no-interaction
46+
before_script:
47+
- if [[ "$HHVMPHP7" ]]; then echo hhvm.php7.all=1 >> /etc/hhvm/php.ini; fi
48+
script: scripts/travis
49+
after_script: scripts/travis-after
50+
51+
env:
52+
global:
53+
- ELOQUENT_PUBLISH_VERSION=7.1
54+
- secure: "V7bH3TNfLs2qDk97qNKGIKVJPfXPmkMcUGweM08jZPrMUPF6zlasQ+15IATBi0yMy08jzcc92ff3SNEwsHRMp63IcpF6XZal4o3SWwAg0M2Szy6T4en5In3ZXucgJt+GxIUISRv9fDoUcxCIxUs7Ufy2cMPKwiUjs8VaAk/T4S7ZfGnv+3sSnF8zIL4IOJ3Q4IcNtAq8Y4a1zcs1M77pzRbug0NEHcnLodX6+Tn1HF1GDy1x3549l8oSCaNG+qPj+aB8g7xSGk6xSr+/GY4KnFfCh0Thu7+EJlDk3hX8OkfgkFOAJmu5sj6gObrtmrqexjwHobntqRDoodi8dgRQouRAbX09zT16yVqApaEzzr31VDA0v8EhVB2zwXkIJ9RXYiKuZksJ7oswRCOl4p9APXR+t/RgXmgKDJZ1JUx84qPBpGP5KdWm9jafKEEZ7MNzZFCUECegATbMmpWEHsgbvfUfoeGQRR4rFzSFzdCCN5aSNakp8t6FFE312/BlM9ox14GrISpMjs23TyoaFxFIm5uR2SBdn7YZ4GB292RA4RcVAgI7kMr12NrjVVxpONODsDOCRNUk+FFq5xAoNBTsX/dEukH3kEPUqIzCLRi0A3TZMR4v33uadNmr25uXYKXKGdFYI80DplnLIdZLpOF+2dPyf4pLLn26rW7ByUNpfok="
55+
56+
cache:
57+
directories:
58+
- $HOME/.composer
59+
- .composer
60+
61+
sudo: false

CHANGELOG.md

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
# Phony for Pho changelog
2+
3+
## Next release
4+
5+
- **[NEW]** Initial release.

CONTRIBUTING.md

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
# Contributing
2+
3+
As a guideline, please follow this process when contributing:
4+
5+
1. [Fork the repository].
6+
2. Create a branch from **master** (`git checkout -b branch-name master`).
7+
3. Make the relevant code changes.
8+
4. Use the various quality checks provided:
9+
- Run the tests with `make test`.
10+
- Generate a coverage report with `make coverage`, then open
11+
`coverage/index.html`.
12+
- Fix code style issues with `make lint`, but be sure to stage changes
13+
first.
14+
- Run the integration tests with `make integration`. There should be one
15+
passing test, and one failing test. This demonstrates *Phony*'s output.
16+
5. [Squash] commits if necessary (`git rebase -i master`).
17+
6. Submit a pull request to the **master** branch.
18+
19+
[fork the repository]: https://help.github.com/articles/fork-a-repo
20+
[squash]: http://git-scm.com/book/en/Git-Tools-Rewriting-History#Changing-Multiple-Commit-Messages

LICENSE

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
Copyright © 2017 Erin Millard
2+
3+
Permission is hereby granted, free of charge, to any person obtaining a copy
4+
of this software and associated documentation files (the "Software"), to deal
5+
in the Software without restriction, including without limitation the rights
6+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
7+
copies of the Software, and to permit persons to whom the Software is
8+
furnished to do so, subject to the following conditions:
9+
10+
The above copyright notice and this permission notice shall be included in
11+
all copies or substantial portions of the Software.
12+
13+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
14+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
15+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
16+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
17+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
18+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
19+
THE SOFTWARE.

Makefile

Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,26 @@
1+
test: install
2+
php --version
3+
vendor/bin/phpunit --no-coverage
4+
5+
coverage: install
6+
phpdbg --version
7+
phpdbg -qrr vendor/bin/phpunit
8+
9+
open-coverage:
10+
open coverage/index.html
11+
12+
integration: install
13+
test/integration/run
14+
15+
lint: test/bin/php-cs-fixer
16+
test/bin/php-cs-fixer fix --using-cache no
17+
18+
install:
19+
composer install
20+
21+
.PHONY: test coverage open-coverage integration lint install
22+
23+
test/bin/php-cs-fixer:
24+
mkdir -p test/bin
25+
curl -sSL http://cs.sensiolabs.org/download/php-cs-fixer-v2.phar -o test/bin/php-cs-fixer
26+
chmod +x test/bin/php-cs-fixer

README.md

Lines changed: 29 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,29 @@
1+
# Phony for Pho
2+
3+
[![Current version image][version-image]][current version]
4+
[![Current build status image][build-image]][current build status]
5+
[![Current Windows build status image][windows-build-image]][current windows build status]
6+
[![Tested against HHVM][hhvm-image]][current hhvm build status]
7+
[![Current coverage status image][coverage-image]][current coverage status]
8+
9+
[build-image]: https://img.shields.io/travis/eloquent/phony-pho/master.svg?style=flat-square "Current build status for the master branch"
10+
[coverage-image]: https://img.shields.io/codecov/c/github/eloquent/phony-pho/master.svg?style=flat-square "Current test coverage for the master branch"
11+
[current build status]: https://travis-ci.org/eloquent/phony-pho
12+
[current coverage status]: https://codecov.io/github/eloquent/phony-pho
13+
[current hhvm build status]: https://travis-ci.org/eloquent/phony-pho
14+
[current version]: https://packagist.org/packages/eloquent/phony-pho
15+
[current windows build status]: https://ci.appveyor.com/project/eloquent/phony-pho
16+
[hhvm-image]: https://img.shields.io/badge/hhvm-tested-brightgreen.svg?style=flat-square "Tested against HHVM"
17+
[version-image]: https://img.shields.io/packagist/v/eloquent/phony-pho.svg?style=flat-square "This project uses semantic versioning"
18+
[windows-build-image]: https://img.shields.io/appveyor/ci/eloquent/phony-pho/master.svg?label=windows&style=flat-square "Current Windows build status for the master branch"
19+
20+
## Installation and documentation
21+
22+
- Available as [Composer] package [eloquent/phony-pho].
23+
- Read the [documentation].
24+
- Visit the [main Phony repository].
25+
26+
[composer]: http://getcomposer.org/
27+
[documentation]: http://eloquent-software.com/phony/latest/
28+
[eloquent/phony-pho]: https://packagist.org/packages/eloquent/phony-pho
29+
[main phony repository]: https://github.com/eloquent/phony

appveyor.yml

Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
version: "{branch}-{build}"
2+
build: false
3+
clone_folder: C:\projects\phony
4+
5+
install:
6+
- cinst OpenSSL.Light -y
7+
- SET PATH=C:\Program Files\OpenSSL;%PATH%
8+
- cinst --allow-empty-checksums php -version 7.0.7 -y
9+
- cd c:\tools\php
10+
- copy php.ini-production php.ini
11+
- echo date.timezone="UTC" >> php.ini
12+
- echo extension_dir=ext >> php.ini
13+
- echo extension=php_openssl.dll >> php.ini
14+
- echo extension=php_curl.dll >> php.ini
15+
- SET PATH=C:\tools\php;%PATH%
16+
- cd C:\projects\phony
17+
- php -r "readfile('http://getcomposer.org/installer');" | php
18+
- php composer.phar install --prefer-source
19+
20+
test_script:
21+
- cd C:\projects\phony
22+
- vendor/bin/phpunit --no-coverage

composer.json

Lines changed: 41 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,41 @@
1+
{
2+
"name": "eloquent/phony-pho",
3+
"description": "Phony for Pho.",
4+
"keywords": ["mock", "mocking", "stub", "stubbing", "spy", "dummy", "double", "test", "fake"],
5+
"homepage": "http://eloquent-software.com/phony/",
6+
"license": "MIT",
7+
"authors": [
8+
{
9+
"name": "Erin Millard",
10+
"email": "ezzatron@gmail.com",
11+
"homepage": "http://ezzatron.com/"
12+
}
13+
],
14+
"require": {
15+
"php": ">=5.4",
16+
"danielstjules/pho": "^1",
17+
"eloquent/phony": "dev-remove-integrations"
18+
},
19+
"require-dev": {
20+
"errors/exceptions": "^0.1",
21+
"phpunit/phpunit": "^4"
22+
},
23+
"autoload": {
24+
"psr-4": {
25+
"Eloquent\\Phony\\Pho\\": "src"
26+
},
27+
"files": [
28+
"src/functions.php"
29+
]
30+
},
31+
"autoload-dev": {
32+
"psr-4": {
33+
"Eloquent\\Phony\\Pho\\": "test/src"
34+
}
35+
},
36+
"config": {
37+
"platform": {
38+
"php": "5.4.99999"
39+
}
40+
}
41+
}

0 commit comments

Comments
 (0)