aboutsummaryrefslogtreecommitdiff
path: root/php
diff options
context:
space:
mode:
authorTimothy Younger <abacaphiliac@gmail.com>2018-07-23 13:33:23 -0700
committerPaul Yang <TeBoring@users.noreply.github.com>2018-07-23 13:33:23 -0700
commit5134f1a3408366c21558fae337128714c0684e23 (patch)
tree9655883d8d36a437691f9d128df0094d624721ce /php
parent2dcd6ae4097d6b7ef570d707c70ee397fc274a52 (diff)
downloadprotobuf-5134f1a3408366c21558fae337128714c0684e23.tar.gz
protobuf-5134f1a3408366c21558fae337128714c0684e23.tar.bz2
protobuf-5134f1a3408366c21558fae337128714c0684e23.zip
Update Composer config in PHP module (#3829)
* Prevents installation of `phpunit/phpunit:^6` because the test cases in this project require `\PHPUnit_Framework_TestCase` which was removed in v6. Moves generated PHP classes for tests into autoload-dev so that they are not referenced in the dist autoload. Adds Composer scripts to run protoc with and without grpc. * update composer test target to use the same commands as generate_php_test_proto in tests.sh
Diffstat (limited to 'php')
-rw-r--r--php/composer.json11
1 files changed, 9 insertions, 2 deletions
diff --git a/php/composer.json b/php/composer.json
index 34e0447c..20f6a45e 100644
--- a/php/composer.json
+++ b/php/composer.json
@@ -9,13 +9,20 @@
"php": ">=5.5.0"
},
"require-dev": {
- "phpunit/phpunit": ">=4.8.0"
+ "phpunit/phpunit": "^5|^4.8.0"
},
"autoload": {
"psr-4": {
"Google\\Protobuf\\": "src/Google/Protobuf",
- "GPBMetadata\\Google\\Protobuf\\": "src/GPBMetadata/Google/Protobuf",
+ "GPBMetadata\\Google\\Protobuf\\": "src/GPBMetadata/Google/Protobuf"
+ }
+ },
+ "autoload-dev": {
+ "psr-4": {
"": "tests/generated"
}
+ },
+ "scripts": {
+ "test": "(cd tests && rm -rf generated && mkdir -p generated && ../../src/protoc --php_out=generated proto/empty/echo.proto proto/test.proto proto/test_include.proto proto/test_no_namespace.proto proto/test_prefix.proto proto/test_php_namespace.proto proto/test_empty_php_namespace.proto proto/test_reserved_enum_lower.proto proto/test_reserved_enum_upper.proto proto/test_reserved_enum_value_lower.proto proto/test_reserved_enum_value_upper.proto proto/test_reserved_message_lower.proto proto/test_reserved_message_upper.proto proto/test_service.proto proto/test_service_namespace.proto proto/test_descriptors.proto) && (cd ../src && ./protoc --php_out=../php/tests/generated -I../php/tests -I. ../php/tests/proto/test_import_descriptor_proto.proto) && vendor/bin/phpunit"
}
}