-
Notifications
You must be signed in to change notification settings - Fork 438
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Move shared testing code into core (#822)
* manual changes * Grpc trait rename * Rename key storage trait * Rename stub * Rename impl * Rename snippet tests * Rename stub * Rename SystemTestCase * Rename DeletionQueue * Move fixtures * Rename stub and impl * Fix locking and fixtures * Fixes * Restructure MockGlobals, update fixtures * Fix phpcs errors * Fix snippet tests * Add comments to support doc building * Exclude MockValues from side effects phpcs rule * Update StubTrait * Remove Storage dependency from StreamableUploaderTest * Move code out of dev * Add snippet testing of parser * Update Iam * Handle servicebuilder tests * Add internal and experimental annotations * Add README to testing directory * Fix phpcs errors * Fix import for doc gen * Add comments to new code in Core/Testing * Update after merge * Address PR comments * Fix reference to impl * Address PR feedback * Exclude Core/Testing from unit tests * Remove extra space * Rename Functions to TestHelpers
- Loading branch information
1 parent
d534eaa
commit b84cfd6
Showing
240 changed files
with
1,116 additions
and
478 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,45 @@ | ||
<?php | ||
/** | ||
* Copyright 2018 Google Inc. | ||
* | ||
* Licensed under the Apache License, Version 2.0 (the "License"); | ||
* you may not use this file except in compliance with the License. | ||
* You may obtain a copy of the License at | ||
* | ||
* http://www.apache.org/licenses/LICENSE-2.0 | ||
* | ||
* Unless required by applicable law or agreed to in writing, software | ||
* distributed under the License is distributed on an "AS IS" BASIS, | ||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | ||
* See the License for the specific language governing permissions and | ||
* limitations under the License. | ||
*/ | ||
|
||
namespace Google\Cloud\Core\Testing; | ||
|
||
/** | ||
* Trait CheckForClassTrait | ||
* | ||
* @experimental | ||
* @internal | ||
*/ | ||
trait CheckForClassTrait | ||
{ | ||
/** | ||
* Check whether all required classes are available, otherwise skip the tests. | ||
* | ||
* @param array $requiredClasses List of classes that must be available. | ||
* | ||
* @experimental | ||
* @internal | ||
*/ | ||
protected function checkAndSkipTest(array $requiredClasses) | ||
{ | ||
foreach ($requiredClasses as $class) { | ||
if (!class_exists($class)) { | ||
$this->markTestSkipped("Missing required class: $class"); | ||
return; | ||
} | ||
} | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
44 changes: 23 additions & 21 deletions
44
tests/unit/Core/Lock/MockGlobals.php → src/Core/Testing/Lock/MockGlobals.php
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.