diff --git a/Core/src/ServiceBuilder.php b/Core/src/ServiceBuilder.php index aa994bbbd9dd..3bf33552b834 100644 --- a/Core/src/ServiceBuilder.php +++ b/Core/src/ServiceBuilder.php @@ -30,7 +30,7 @@ use Google\Cloud\Storage\StorageClient; use Google\Cloud\Trace\TraceClient; use Google\Cloud\Translate\V2\TranslateClient as DeprecatedTranslateClient; -use Google\Cloud\Translate\V3\Client\TranslateClient; +use Google\Cloud\Translate\V3\Client\TranslationServiceClient; use Google\Cloud\Vision\VisionClient; use Psr\Cache\CacheItemPoolInterface; @@ -358,7 +358,7 @@ public function vision(array $config = []) /** * @deprecated - * @see TranslateClient + * @see TranslationServiceClient * @throws \BadMethodCallException */ public function translate(array $config = []) @@ -367,8 +367,8 @@ public function translate(array $config = []) return $this->createClient(DeprecatedTranslateClient::class, 'translate', $config); } throw new \BadMethodCallException(sprintf( - 'This method is no longer supported, create %s directly instead.'. - SpeechClient::class + 'This method is no longer supported, create %s directly instead.', + TranslationServiceClient::class )); } diff --git a/Core/tests/Snippet/ServiceBuilderTest.php b/Core/tests/Snippet/ServiceBuilderTest.php index d6746317c5d3..2ad7a4da74be 100644 --- a/Core/tests/Snippet/ServiceBuilderTest.php +++ b/Core/tests/Snippet/ServiceBuilderTest.php @@ -29,7 +29,6 @@ use Google\Cloud\Speech\SpeechClient; use Google\Cloud\Storage\StorageClient; use Google\Cloud\Trace\TraceClient; -use Google\Cloud\Translate\TranslateClient; use Google\Cloud\Vision\VisionClient; /** @@ -64,7 +63,6 @@ public function serviceBuilderMethods() ['storage', StorageClient::class, 'storage'], ['trace', TraceClient::class, 'trace'], ['vision', VisionClient::class, 'vision'], - ['translate', TranslateClient::class, 'translate'] ]; } diff --git a/Core/tests/Unit/ServiceBuilderTest.php b/Core/tests/Unit/ServiceBuilderTest.php index 3667628bb299..eac970bca82a 100644 --- a/Core/tests/Unit/ServiceBuilderTest.php +++ b/Core/tests/Unit/ServiceBuilderTest.php @@ -28,7 +28,6 @@ use Google\Cloud\Speech\SpeechClient; use Google\Cloud\Storage\StorageClient; use Google\Cloud\Core\Tests\Unit\Fixtures; -use Google\Cloud\Translate\TranslateClient; use Google\Cloud\Vision\VisionClient; use GuzzleHttp\Psr7\Response; use PHPUnit\Framework\TestCase; @@ -68,17 +67,6 @@ public function testBuildsClients($serviceName, $expectedClient, array $args = [ $this->assertInstanceOf($expectedClient, $localConfigClient); } - public function testTranslateClientWithApiKey() - { - $this->checkAndSkipTest([TranslateClient::class]); - - $config = ['key' => 'test_key']; - $serviceBuilder = new ServiceBuilder($config); - - $this->assertInstanceOf(TranslateClient::class, $serviceBuilder->translate()); - $this->assertInstanceOf(TranslateClient::class, $serviceBuilder->translate($config)); - } - /** * @dataProvider serviceProvider */ @@ -187,9 +175,6 @@ public function serviceProvider() ], [ 'storage', StorageClient::class - ], [ - 'translate', - TranslateClient::class ], [ 'vision', VisionClient::class diff --git a/Core/tests/Unit/ServicesNotFoundTest.php b/Core/tests/Unit/ServicesNotFoundTest.php index c4201bf0f703..b24ba6ff827c 100644 --- a/Core/tests/Unit/ServicesNotFoundTest.php +++ b/Core/tests/Unit/ServicesNotFoundTest.php @@ -74,7 +74,6 @@ private static function getApis() "Speech", "Storage", "Trace", - "Translate", "VideoIntelligence", "Vision", ]; @@ -93,7 +92,6 @@ public function serviceBuilderMethods() ['storage'], ['trace'], ['vision'], - ['translate'] ]; }