Skip to content

Commit

Permalink
fix tests
Browse files Browse the repository at this point in the history
  • Loading branch information
bshaffer committed Dec 11, 2024
1 parent 628fa3e commit 726c1da
Show file tree
Hide file tree
Showing 4 changed files with 4 additions and 23 deletions.
8 changes: 4 additions & 4 deletions Core/src/ServiceBuilder.php
Original file line number Diff line number Diff line change
Expand Up @@ -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;

Expand Down Expand Up @@ -358,7 +358,7 @@ public function vision(array $config = [])

/**
* @deprecated
* @see TranslateClient
* @see TranslationServiceClient
* @throws \BadMethodCallException
*/
public function translate(array $config = [])
Expand All @@ -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
));
}

Expand Down
2 changes: 0 additions & 2 deletions Core/tests/Snippet/ServiceBuilderTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -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;

/**
Expand Down Expand Up @@ -64,7 +63,6 @@ public function serviceBuilderMethods()
['storage', StorageClient::class, 'storage'],
['trace', TraceClient::class, 'trace'],
['vision', VisionClient::class, 'vision'],
['translate', TranslateClient::class, 'translate']
];
}

Expand Down
15 changes: 0 additions & 15 deletions Core/tests/Unit/ServiceBuilderTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down Expand Up @@ -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
*/
Expand Down Expand Up @@ -187,9 +175,6 @@ public function serviceProvider()
], [
'storage',
StorageClient::class
], [
'translate',
TranslateClient::class
], [
'vision',
VisionClient::class
Expand Down
2 changes: 0 additions & 2 deletions Core/tests/Unit/ServicesNotFoundTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -74,7 +74,6 @@ private static function getApis()
"Speech",
"Storage",
"Trace",
"Translate",
"VideoIntelligence",
"Vision",
];
Expand All @@ -93,7 +92,6 @@ public function serviceBuilderMethods()
['storage'],
['trace'],
['vision'],
['translate']
];
}

Expand Down

0 comments on commit 726c1da

Please sign in to comment.