diff --git a/.travis.yml b/.travis.yml index a0f9e9157..0db93a3b1 100644 --- a/.travis.yml +++ b/.travis.yml @@ -7,7 +7,7 @@ php: sudo: required dist: trusty install: - - pecl install grpc + - travis_retry pecl install grpc - composer install script: - vendor/bin/phpunit --coverage-clover=coverage.xml diff --git a/src/generated/Google/Logging/Type/LogSeverity.php b/src/generated/Google/Logging/Type/LogSeverity.php index c244d3355..bbd397108 100644 --- a/src/generated/Google/Logging/Type/LogSeverity.php +++ b/src/generated/Google/Logging/Type/LogSeverity.php @@ -27,7 +27,7 @@ class LogSeverity * * Generated from protobuf enum DEFAULT = 0; */ - const DEFAULT = 0; + const GPBDEFAULT = 0; /** * (100) Debug or trace information. * diff --git a/tests/InstantiateClassesTest.php b/tests/InstantiateClassesTest.php new file mode 100644 index 000000000..abf5a6dcd --- /dev/null +++ b/tests/InstantiateClassesTest.php @@ -0,0 +1,67 @@ + null]); + } else { + $instance = new $class(); + } + $this->assertNotNull($instance); + } + + public function classesProvider() + { + $dir = new RecursiveDirectoryIterator('src/generated/Google'); + $it = new RecursiveIteratorIterator($dir); + $reg = new RegexIterator($it, '#.+\.php$#', RecursiveRegexIterator::GET_MATCH); + foreach ($reg as $files) { + $file = $files[0]; + $namespace = str_replace("/", "\\", substr($file, 13)); + $class = explode('.', $namespace)[0]; + yield [$class]; + } + } +}