]> source.dussan.org Git - nextcloud-server.git/commitdiff
Changed fail for assertEquals and removed fields which weren't checked
authorSergio Bertolin <sbertolin@solidgear.es>
Thu, 3 Dec 2015 12:54:44 +0000 (12:54 +0000)
committerSergio Bertolin <sbertolin@solidgear.es>
Thu, 3 Dec 2015 12:54:44 +0000 (12:54 +0000)
build/integration/capabilities_features/capabilities.feature
build/integration/features/bootstrap/CapabilitiesContext.php

index 4adb884e80ab54cee13e4266fb00106417688ffd..6c1e727e7b3d9f5c75252bb4a271bd91284997e9 100644 (file)
@@ -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 |
index a1a14aa3bb30c97b93b9906f94438f09fff24ff6..4e200bdf421826d5fe444130b4240781772d51f2 100644 (file)
@@ -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']
+                               );
                        }
                }
        }