Commit 584c6aff authored by Rebecca Blundell's avatar Rebecca Blundell
Browse files

Bug 1772792: Update behat for php7.2

- changed composer dependencies to make 7.2 work
- switched to carat syntax which allows upgrade up to anything below the next major version.
- fixed use of count to check for null in Behat2Renderer.php
- tested dependencies with php 5.6, 7.0, 7.1, 7.2. You do need to
  manually delete the composer.lock file and run make initcomposer to resolve issues.

behatnotneeded

Change-Id: I725d8ac6a2f8ca9d67c95d7d6184882a364c0762
parent c6f82f81
{
"require": {
"php": ">=5.3.3",
"behat/behat": ">=3.1.0",
"behat/mink": ">=1.7.1",
"behat/mink-extension": ">=2.2",
"behat/mink-goutte-driver": ">=1.2.1",
"behat/mink-selenium2-driver": ">=1.3.1",
"emuse/behat-html-formatter": ">=0.1",
"fabpot/goutte": ">=3.1.2",
"guzzlehttp/guzzle": ">=6.2.1",
"phpunit/phpunit": ">=3.7.38"
"php": ">=5.5.6",
"behat/behat": "^3.4.0",
"behat/mink": "^1.7",
"behat/mink-extension": "^2.3",
"behat/mink-goutte-driver": "^1.1",
"behat/mink-selenium2-driver": "^1.3",
"emuse/behat-html-formatter": "^0.1",
"fabpot/goutte": "^3.2",
"guzzlehttp/guzzle": "^6.3.0",
"phpunit/phpunit": "^4.5"
},
"autoload": {
......
......@@ -56,58 +56,65 @@ class Behat2Renderer
public function renderAfterExercise($obj) {
//--> features results
$strFeatPassed = '' ;
if (count($obj->getPassedFeatures()) > 0) {
$featTotal = 0;
$sceTotal = 0;
$stepsTotal = 0;
if (null!==$obj->getPassedFeatures() && count($obj->getPassedFeatures()) > 0) {
$strFeatPassed = ' <strong class="passed">'.count($obj->getPassedFeatures()).' success</strong>';
$featTotal += count($obj->getPassedFeatures());
}
$strFeatFailed = '' ;
$sumRes = 'passed' ;
if (count($obj->getFailedFeatures()) > 0) {
if (null!==$obj->getFailedFeatures() && count($obj->getFailedFeatures()) > 0) {
$strFeatFailed = ' <strong class="failed">'.count($obj->getFailedFeatures()).' fail</strong>';
$sumRes = 'failed' ;
$featTotal += count($obj->getFailedFeatures());
}
//--> scenarios results
$strScePassed = '' ;
if (count($obj->getPassedScenarios()) > 0) {
if (null!==$obj->getPassedScenarios() && count($obj->getPassedScenarios()) > 0) {
$strScePassed = ' <strong class="passed">'.count($obj->getPassedScenarios()).' success</strong>';
$sceTotal += count($obj->getPassedScenarios());
}
$strSceFailed = '' ;
if (count($obj->getFailedScenarios()) > 0) {
if (null!==$obj->getFailedScenarios() && count($obj->getFailedScenarios()) > 0) {
$strSceFailed = ' <strong class="failed">'.count($obj->getFailedScenarios()).' fail</strong>';
$sceTotal += count($obj->getFailedScenarios());
}
//--> steps results
$strStepsPassed = '' ;
if (count($obj->getPassedSteps()) > 0) {
if (null!==$obj->getPassedSteps() && count($obj->getPassedSteps()) > 0) {
$strStepsPassed = ' <strong class="passed">'.count($obj->getPassedSteps()).' success</strong>';
$stepsTotal += count($obj->getPassedSteps());
}
$strStepsPending = '' ;
if (count($obj->getPendingSteps()) > 0) {
if (null!==$obj->getPendingSteps() && count($obj->getPendingSteps()) > 0) {
$strStepsPending = ' <strong class="pending">'.count($obj->getPendingSteps()).' pending</strong>';
$stepsTotal += count($obj->getPendingSteps());
}
$strStepsSkipped = '' ;
if (count($obj->getSkippedSteps()) > 0) {
if (null!==$obj->getSkippedSteps() && count($obj->getSkippedSteps()) > 0) {
$strStepsSkipped = ' <strong class="skipped">'.count($obj->getSkippedSteps()).' skipped</strong>';
$stepsTotal += count($obj->getSkippedSteps());
}
$strStepsFailed = '' ;
if (count($obj->getFailedSteps()) > 0) {
if (null!==$obj->getFailedSteps() && count($obj->getFailedSteps()) > 0) {
$strStepsFailed = ' <strong class="failed">'.count($obj->getFailedSteps()).' fail</strong>';
$stepsTotal += count($obj->getFailedSteps());
}
//totals
$featTotal = (count($obj->getFailedFeatures()) + count($obj->getPassedFeatures()));
$sceTotal = (count($obj->getFailedScenarios()) + count($obj->getPassedScenarios())) ;
$stepsTotal = (count($obj->getFailedSteps()) + count($obj->getPassedSteps()) + count($obj->getSkippedSteps()) + count($obj->getPendingSteps())) ;
//list of pending steps to display
$strPendingList = '' ;
if (count($obj->getPendingSteps()) > 0) {
if (null!==$obj->getPendingSteps() && count($obj->getPendingSteps()) > 0) {
foreach($obj->getPendingSteps() as $pendingStep) {
$strPendingList .= '
<li>' . $pendingStep->getKeyword() . ' ' . $pendingStep->getText() . '</li>' ;
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment