Skip to content
Snippets Groups Projects
Commit c744b30b authored by Sergio Bertolin's avatar Sergio Bertolin
Browse files

Changed fail for assertEquals and removed fields which weren't checked

parent e01e894b
No related branches found
No related tags found
No related merge requests found
......@@ -12,9 +12,6 @@ Feature: capabilities
| core | webdav-root | remote.php/webdav | |
| files_sharing | api_enabled | 1 | |
| files_sharing | public | enabled | 1 |
| files_sharing | public | password | 1 |
| files_sharing | public | expire_date | 1 |
| files_sharing | public | send_mail | 1 |
| files_sharing | public | upload | 1 |
| files_sharing | resharing | 1 | |
| files_sharing | federation | outgoing | 1 |
......
......@@ -29,15 +29,19 @@ class CapabilitiesContext implements Context, SnippetAcceptingContext {
foreach ($fd as $row) {
if ($row['value'] === ''){
$answeredValue = (string)$capabilitiesXML->$row['capability']->$row['feature']->$row['value_or_subfeature'];
if ( !$answeredValue === $row['value_or_subfeature']){
PHPUnit_Framework_Assert::fail("Answered value $answeredValue is different to expected " . $row['value_or_subfeature']);
}
$answeredValue = (string)$capabilitiesXML->$row['capability']->$row['feature'];
PHPUnit_Framework_Assert::assertEquals(
$answeredValue,
$row['value_or_subfeature'],
"Failed field " . $row['capability'] . " " . $row['feature']
);
} else{
$answeredValue = (string)$capabilitiesXML->$row['capability']->$row['feature']->$row['value_or_subfeature']->$row['value'];
if ( !$answeredValue === $row['value']){
PHPUnit_Framework_Assert::fail("Answered value $answeredValue is different to expected " . $row['value']);
}
$answeredValue = (string)$capabilitiesXML->$row['capability']->$row['feature']->$row['value_or_subfeature'];
PHPUnit_Framework_Assert::assertEquals(
$answeredValue,
$row['value'],
"Failed field: " . $row['capability'] . " " . $row['feature'] . " " . $row['value_or_subfeature']
);
}
}
}
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment