Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add Environment Name To Descriptor Unique Signatures #5294

Merged
merged 16 commits into from Dec 19, 2018
Merged
Changes from 15 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
9 changes: 8 additions & 1 deletion src/Codeception/Test/Descriptor.php
Expand Up @@ -32,15 +32,22 @@ public static function getTestSignature(\PHPUnit\Framework\SelfDescribing $testC
*/
public static function getTestSignatureUnique(\PHPUnit\Framework\SelfDescribing $testCase)
{
$env = null;
Naktibalda marked this conversation as resolved.
Show resolved Hide resolved
$example = null;

if (method_exists($testCase, 'getScenario')
&& $env = $testCase->getScenario()->current('env')
Naktibalda marked this conversation as resolved.
Show resolved Hide resolved
) {
$env = ':' . $env;
}

if (method_exists($testCase, 'getMetaData')
&& $example = $testCase->getMetadata()->getCurrent('example')
) {
$example = ':' . substr(sha1(json_encode($example)), 0, 7);
}

return self::getTestSignature($testCase) . $example;
return self::getTestSignature($testCase) . $env . $example;
}

public static function getTestAsString(\PHPUnit\Framework\SelfDescribing $testCase)
Expand Down