diff --git a/bin/test.rb b/bin/test.rb index 6071e996..118480e7 100755 --- a/bin/test.rb +++ b/bin/test.rb @@ -19,7 +19,7 @@ require "fileutils" require "rbconfig" require "shellwords" -require 'optparse' +require "optparse" DEFAULT_PHP_NAME = "php" CB_PHP_NAME = ENV.fetch("CB_PHP_NAME", DEFAULT_PHP_NAME) @@ -130,7 +130,7 @@ def find_extension(name_pattern, project_root, module_location_candidates) php_unit_phar = File.join(build_root, "phpunit.phar") unless File.file?(php_unit_phar) - php_unit_version = "9.5" + php_unit_version = "10.5.38" php_unit_url = "https://phar.phpunit.de/phpunit-#{php_unit_version}.phar" FileUtils.mkdir_p(File.dirname(php_unit_phar)) run("curl -L -o #{php_unit_phar.shellescape} #{php_unit_url}") @@ -159,9 +159,7 @@ def find_extension(name_pattern, project_root, module_location_candidates) end end -if extra_php_args.empty? - abort "Unable to find the module. Candidates: #{module_location_candidates.inspect}" -end +abort "Unable to find the module. Candidates: #{module_location_candidates.inspect}" if extra_php_args.empty? tests = ARGV.to_a tests << File.join(project_root, "tests") if tests.empty? diff --git a/tests/Helpers/ConsistencyUtils.php b/tests/Helpers/ConsistencyUtils.php index f3f8e496..44617ef7 100644 --- a/tests/Helpers/ConsistencyUtils.php +++ b/tests/Helpers/ConsistencyUtils.php @@ -254,7 +254,7 @@ public function waitUntilCollectionDropped(string $bucketName, string $scopeName ); } - public function waitUntilBucketUpdated(string $bucketName, callable $predicate, string $errorMsg = null): void + public function waitUntilBucketUpdated(string $bucketName, callable $predicate, ?string $errorMsg = null): void { fprintf(STDERR, "waiting until bucket %s has been updated\n", $bucketName); @@ -267,7 +267,7 @@ public function waitUntilBucketUpdated(string $bucketName, callable $predicate, ); } - public function waitUntilCollectionUpdated(string $bucketName, string $scopeName, string $collectionName, callable $predicate, string $errorMsg = null): void + public function waitUntilCollectionUpdated(string $bucketName, string $scopeName, string $collectionName, callable $predicate, ?string $errorMsg = null): void { fprintf(STDERR, "waiting until collection %s on scope %s on bucket %s has updated\n", $collectionName, $scopeName, $bucketName); diff --git a/tests/Helpers/CouchbaseTestCase.php b/tests/Helpers/CouchbaseTestCase.php index 37793f8e..273c567d 100644 --- a/tests/Helpers/CouchbaseTestCase.php +++ b/tests/Helpers/CouchbaseTestCase.php @@ -100,7 +100,7 @@ public function connectClusterUnique(?ClusterOptions $options = null): ClusterIn return Cluster::connect($connstr, $options); } - public function openBucket(string $name = null): BucketInterface + public function openBucket(?string $name = null): BucketInterface { if ($name == null) { $name = self::env()->bucketName(); @@ -108,7 +108,7 @@ public function openBucket(string $name = null): BucketInterface return $this->connectCluster()->bucket($name); } - public function defaultCollection(string $bucketName = null): CollectionInterface + public function defaultCollection(?string $bucketName = null): CollectionInterface { if ($bucketName == null) { $bucketName = self::env()->bucketName(); @@ -121,7 +121,7 @@ public function consistencyUtil(): ConsistencyUtils return self::env()->consistencyUtil(); } - public function uniqueId(string $prefix = null): string + public function uniqueId(?string $prefix = null): string { if ($prefix != null) { return sprintf("%s_%s", $prefix, self::env()::randomId());