Skip to content

Commit

Permalink
Merge pull request #1 from abacaphiliac/travis-and-readme
Browse files Browse the repository at this point in the history
add travis config and readme
  • Loading branch information
tklever authored Sep 12, 2016
2 parents ef84854 + aece061 commit ca0e86f
Show file tree
Hide file tree
Showing 6 changed files with 110 additions and 3 deletions.
18 changes: 18 additions & 0 deletions .travis.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
language: php
php:
- 5.5
- 5.6
- 7.0
- hhvm
env:
- COMPOSER_OPTS=""
- COMPOSER_OPTS="--prefer-lowest"
matrix:
allow_failures:
- php: hhvm
fast_finish: true
before_script:
- composer self-update
- composer update --no-interaction
script:
- vendor/bin/phing
29 changes: 29 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
# klever/tutor
Easily test accessor methods on your models by providing a spec in your test case.

# Installation
```bash
composer require --dev klever/tutor
```

# Usage
Extend `\Klever\Tutor\AccessMethod\AbstractTestCase` and provide a spec for your model.

# Example
[`\Klever\TutorTest\AccessMethod\AbstractTestCaseIntegrationTest`](test/TutorTest/AccessMethod/AbstractTestCaseIntegrationTest.php)

# Dependencies
See [composer.json](composer.json).

## Contributing
```bash
git clone [email protected]:tklever/tutor.git && cd tutor
composer update && vendor/bin/phing
```

This library attempts to comply with [PSR-1][], [PSR-2][], and [PSR-4][]. If
you notice compliance oversights, please send a patch via pull request.

[PSR-1]: https://github.com/php-fig/fig-standards/blob/master/accepted/PSR-1-basic-coding-standard.md
[PSR-2]: https://github.com/php-fig/fig-standards/blob/master/accepted/PSR-2-coding-style-guide.md
[PSR-4]: https://github.com/php-fig/fig-standards/blob/master/accepted/PSR-4-autoloader.md
58 changes: 58 additions & 0 deletions build.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,58 @@
<project name="klever/tutor" default="develop" basedir=".">

<target name="develop">
<phingcall target="lint"/>
<phingcall target="tests"/>
</target>

<target name="lint">
<phingcall target="php-lint"/>
<phingcall target="phpcs"/>
</target>

<target name="php-lint">
<exec command="vendor/bin/parallel-lint src test"
passthru="true"
output="/dev/stdout"
error="/dev/stdout"
checkreturn="true"/>
</target>

<target name="phpcs">
<exec command="vendor/bin/phpcs --standard=PSR2 --colors -p src/ test/"
passthru="true"
output="/dev/stdout"
error="/dev/stdout"
checkreturn="true"/>
</target>

<target name="phpcbf">
<exec command="vendor/bin/phpcbf --standard=PSR2 --colors -p src/ test/"
passthru="true"
output="/dev/stdout"
error="/dev/stdout"
checkreturn="true"/>
</target>

<target name="tests">
<phingcall target="unit-tests"/>
<phingcall target="mutation-tests"/>
</target>

<target name="unit-tests">
<exec command="vendor/bin/phpunit --coverage-text"
passthru="true"
output="/dev/stdout"
error="/dev/stdout"
checkreturn="true"/>
</target>

<target name="mutation-tests">
<exec command="vendor/bin/humbug"
passthru="true"
output="/dev/stdout"
error="/dev/stdout"
checkreturn="true"/>
</target>

</project>
5 changes: 4 additions & 1 deletion composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -18,10 +18,13 @@
}
},
"require": {
"phpunit/phpunit": "^5.2"
"php": "^7.0|^5.5",
"phpunit/phpunit": "^5.0|^4.8"
},
"require-dev": {
"jakub-onderka/php-parallel-lint": "^0.9",
"squizlabs/php_codesniffer": "^2.5",
"phing/phing": "^2.9",
"humbug/humbug": "dev-master"
}
}
1 change: 0 additions & 1 deletion src/Tutor/AccessMethod/TestConfiguration.php
Original file line number Diff line number Diff line change
Expand Up @@ -105,7 +105,6 @@ private function setInjectionMethodTest($injectionMethodTest)
{
$this->injectionMethodTest = (bool) $injectionMethodTest;
$this->injectionMethodTestExplicit = true;

}

/**
Expand Down
2 changes: 1 addition & 1 deletion test/TutorTest/Constraint/ArrayHasKeyAndTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ class ArrayHasKeyAndTest extends \PHPUnit_Framework_TestCase

protected function setUp()
{
$this->subConstraint = $subConstraint = $this->getMock(PHPUnit_Framework_Constraint::class);
$this->subConstraint = $subConstraint = $this->getMockBuilder(PHPUnit_Framework_Constraint::class)->getMock();
$this->subConstraint = $subConstraint = new PHPUnit_Framework_Constraint_IsEqual('bar');
$this->constraint = new ArrayHasKeyAnd('foo', $subConstraint);
}
Expand Down

0 comments on commit ca0e86f

Please sign in to comment.