mirror of
https://github.com/danog/parallel-functions.git
synced 2024-11-29 20:29:15 +01:00
Make use of composer scripts and add a further test
This commit is contained in:
parent
a73ac158c3
commit
d7f396df2b
@ -28,7 +28,7 @@ script:
|
||||
# Run with phpdbg or xdebug as soon as one of both doesn't segfault anymore
|
||||
- vendor/bin/phpunit --coverage-text --coverage-clover build/logs/clover.xml
|
||||
- (for f in examples/*.php; do echo $f && if ! php $f; then echo '!! failed !!' && exit 1; fi && echo "-------"; done)
|
||||
- PHP_CS_FIXER_IGNORE_ENV=1 php vendor/bin/php-cs-fixer --diff --dry-run -v fix
|
||||
- PHP_CS_FIXER_IGNORE_ENV=1 composer fix-syntax -- --dry-run
|
||||
|
||||
after_script:
|
||||
- ./coveralls.phar -v
|
||||
|
@ -17,6 +17,11 @@
|
||||
"src/functions.php"
|
||||
]
|
||||
},
|
||||
"autoload-dev": {
|
||||
"psr-4": {
|
||||
"Amp\\ParallelFunctions\\Test\\": "test"
|
||||
}
|
||||
},
|
||||
"require": {
|
||||
"php": ">=7",
|
||||
"amphp/parallel": "^0.1.8 || ^0.2",
|
||||
@ -32,5 +37,8 @@
|
||||
"platform": {
|
||||
"php": "7.0.0"
|
||||
}
|
||||
},
|
||||
"scripts": {
|
||||
"fix-syntax": "php vendor/bin/php-cs-fixer --diff -v fix"
|
||||
}
|
||||
}
|
||||
|
@ -74,4 +74,16 @@ class FilterTest extends TestCase {
|
||||
$this->assertStringEqualsFile($files[2][1], '2');
|
||||
}
|
||||
}
|
||||
|
||||
public function testFilterWithNullCallable() {
|
||||
$this->expectException(\Error::class);
|
||||
|
||||
$files = [
|
||||
[0, \tempnam(\sys_get_temp_dir(), 'amp-parallel-functions-')],
|
||||
[1, \tempnam(\sys_get_temp_dir(), 'amp-parallel-functions-')],
|
||||
[2, \tempnam(\sys_get_temp_dir(), 'amp-parallel-functions-')],
|
||||
];
|
||||
|
||||
wait(parallelFilter($files, null, ARRAY_FILTER_USE_BOTH));
|
||||
}
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user