Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Use php-parser v3 #69

Merged
merged 7 commits into from
Jul 4, 2017
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
17 changes: 13 additions & 4 deletions .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,22 +2,31 @@ language: php

php:
- 7.0
- 7.1
- hhvm
- nightly

env:
matrix:
- DEPENDENCIES="high"
- DEPENDENCIES="low"

matrix:
allow_failures:
- php: hhvm
- php: nightly

before_script:
- composer self-update
- composer update --prefer-source --dev
- if [ "$DEPENDENCIES" = "high" ]; then composer --prefer-source update; fi;
- if [ "$DEPENDENCIES" = "low" ]; then composer --prefer-lowest --prefer-source update; fi;

script:
- ./vendor/bin/phpunit --coverage-clover ./build/logs/clover.xml --exclude-group Functional
- ./vendor/bin/phpunit --group=Functional
- php -n ./vendor/bin/phpbench run --report=aggregate --revs=500 --iterations=50 --warmup=3
- ./vendor/bin/phpcs --standard=PSR2 ./src/ ./tests/ ./benchmarks
# Only run the code standards with the latest package
- if [ "$DEPENDENCIES" = "high" ]; then ./vendor/bin/phpcs --standard=PSR2 ./src/ ./tests/ ./benchmarks; fi;

after_script:
- if [[ $TRAVIS_PHP_VERSION = '7.0' ]]; then wget https://scrutinizer-ci.com/ocular.phar; fi
- if [[ $TRAVIS_PHP_VERSION = '7.0' ]]; then php ocular.phar code-coverage:upload --format=php-clover build/logs/clover.xml; fi
- if [[ $TRAVIS_PHP_VERSION = '7.0' ]]; then php ocular.phar code-coverage:upload --format=php-clover build/logs/clover.xml; fi
11 changes: 6 additions & 5 deletions composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -20,16 +20,17 @@
],
"require": {
"php": "~7.0",
"nikic/php-parser": "~2.0",
"ocramius/code-generator-utils": "0.4.*",
"nikic/php-parser": "~2.0|~3.0",
"ocramius/code-generator-utils": "~0.4",
"zendframework/zend-hydrator": "^2.0"
},
"require-dev": {
"phpunit/phpunit": "~5.0",
"squizlabs/php_codesniffer": "~2.0",
"phpunit/phpunit": "^5.7.21",
"squizlabs/php_codesniffer": "^3.0",
"phpbench/phpbench": "^0.13.0",
"zendframework/zend-filter": "^2.7",
"zendframework/zend-servicemanager": "^3.2"
"zendframework/zend-servicemanager": "^3.2",
"zendframework/zend-stdlib": "^3.1"
},
"autoload": {
"psr-0": {
Expand Down
10 changes: 5 additions & 5 deletions tests/GeneratedHydratorTest/Factory/HydratorFactoryTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -137,24 +137,24 @@ public function testWillTryAutoGeneration()
return true;
});

$this
$this
->inflector
->expects(self::once())
->method('getGeneratedClassName')
->with('GeneratedHydratorTestAsset\\BaseClass')
->will(self::returnValue($generatedClassName));

$this
$this
->inflector
->expects(self::once())
->method('getUserClassName')
->with($className)
->will(self::returnValue('GeneratedHydratorTestAsset\\BaseClass'));

$factory = new HydratorFactory($this->config);
$factory = new HydratorFactory($this->config);
/* @var $generatedClass \GeneratedHydratorTestAsset\LazyLoadingMock */
$generatedClass = $factory->getHydratorClass();
$generatedClass = $factory->getHydratorClass();

self::assertInstanceOf($generatedClassName, new $generatedClass);
self::assertInstanceOf($generatedClassName, new $generatedClass);
}
}