INFRA-132 - CaseTypeTest - Spacing errors
authorTim Otten <totten@civicrm.org>
Mon, 12 Jan 2015 23:48:15 +0000 (15:48 -0800)
committerTim Otten <totten@civicrm.org>
Tue, 13 Jan 2015 00:32:26 +0000 (16:32 -0800)
tests/phpunit/CRM/Case/BAO/CaseTypeTest.php
tests/phpunit/CRM/Case/BAO/xml/empty-defn.xml [new file with mode: 0644]
tests/phpunit/CRM/Case/BAO/xml/empty-lists.xml [new file with mode: 0644]
tests/phpunit/CRM/Case/BAO/xml/forkable-0.xml [new file with mode: 0644]
tests/phpunit/CRM/Case/BAO/xml/forkable-1.xml [new file with mode: 0644]
tests/phpunit/CRM/Case/BAO/xml/one-item-in-each.xml [new file with mode: 0644]
tests/phpunit/CRM/Case/BAO/xml/two-items-in-each.xml [new file with mode: 0644]

index 49f65cc25baf455235dfa87602d968be5fd0013d..6e4605e9c828ff34d4b94a74816cd6c8325a9e43 100644 (file)
@@ -15,11 +15,7 @@ class CRM_Case_BAO_CaseTypeTest extends CiviUnitTestCase {
   public function definitionProvider() {
     $fixtures['empty-defn'] = array(
       'json' => json_encode(array()),
-      'xml' => '<?xml version="1.0" encoding="utf-8" ?>
-<CaseType>
-  <name>Housing Support</name>
-</CaseType>
-      ',
+      'xml' => file_get_contents(__DIR__ . '/xml/empty-defn.xml'),
     );
 
     $fixtures['empty-lists'] = array(
@@ -28,14 +24,7 @@ class CRM_Case_BAO_CaseTypeTest extends CiviUnitTestCase {
         'activityTypes' => array(),
         'caseRoles' => array(),
       )),
-      'xml' => '<?xml version="1.0" encoding="utf-8" ?>
-<CaseType>
-  <name>Housing Support</name>
-  <ActivityTypes></ActivityTypes>
-  <ActivitySets></ActivitySets>
-  <CaseRoles></CaseRoles>
-</CaseType>
-      ',
+      'xml' => file_get_contents(__DIR__ . '/xml/empty-lists.xml'),
     );
 
     $fixtures['one-item-in-each'] = array(
@@ -57,36 +46,7 @@ class CRM_Case_BAO_CaseTypeTest extends CiviUnitTestCase {
           array('name' => 'First role', 'creator' => 1, 'manager' => 1),
         ),
       )),
-      'xml' => '<?xml version="1.0" encoding="utf-8" ?>
-<CaseType>
-  <name>Housing Support</name>
-  <ActivityTypes>
-    <ActivityType>
-      <name>First act (foréign éxamplé)</name>
-    </ActivityType>
-  </ActivityTypes>
-  <ActivitySets>
-    <ActivitySet>
-      <name>set1</name>
-      <label>Label 1</label>
-      <timeline>true</timeline>
-      <ActivityTypes>
-        <ActivityType>
-          <name>Open Case</name>
-          <status>Completed</status>
-        </ActivityType>
-      </ActivityTypes>
-    </ActivitySet>
-  </ActivitySets>
-  <CaseRoles>
-    <RelationshipType>
-      <name>First role</name>
-      <creator>1</creator>
-      <manager>1</manager>
-    </RelationshipType>
-  </CaseRoles>
-</CaseType>
-      ',
+      'xml' => file_get_contents(__DIR__ . '/xml/one-item-in-each.xml'),
     );
 
     $fixtures['two-items-in-each'] = array(
@@ -125,85 +85,21 @@ class CRM_Case_BAO_CaseTypeTest extends CiviUnitTestCase {
           array('name' => 'Second role'),
         ),
       )),
-      'xml' => '<?xml version="1.0" encoding="utf-8" ?>
-<CaseType>
-  <name>Housing Support</name>
-  <ActivityTypes>
-    <ActivityType>
-      <name>First act</name>
-    </ActivityType>
-    <ActivityType>
-      <name>Second act</name>
-    </ActivityType>
-  </ActivityTypes>
-  <ActivitySets>
-    <ActivitySet>
-      <name>set1</name>
-      <label>Label 1</label>
-      <timeline>true</timeline>
-      <ActivityTypes>
-        <ActivityType>
-          <name>Open Case</name>
-          <status>Completed</status>
-        </ActivityType>
-        <ActivityType>
-          <name>Meeting</name>
-          <reference_activity>Open Case</reference_activity>
-          <reference_offset>1</reference_offset>
-          <reference_select>newest</reference_select>
-        </ActivityType>
-      </ActivityTypes>
-    </ActivitySet>
-    <ActivitySet>
-      <name>set2</name>
-      <label>Label 2</label>
-      <sequence>true</sequence>
-      <ActivityTypes>
-        <ActivityType>
-          <name>First act</name>
-        </ActivityType>
-        <ActivityType>
-          <name>Second act</name>
-        </ActivityType>
-      </ActivityTypes>
-    </ActivitySet>
-  </ActivitySets>
-  <CaseRoles>
-    <RelationshipType>
-      <name>First role</name>
-      <creator>1</creator>
-      <manager>1</manager>
-    </RelationshipType>
-    <RelationshipType>
-      <name>Second role</name>
-    </RelationshipType>
-  </CaseRoles>
-</CaseType>
-      ',
+      'xml' => file_get_contents(__DIR__ . '/xml/two-items-in-each.xml'),
     );
 
     $fixtures['forkable-0'] = array(
       'json' => json_encode(array(
         'forkable' => 0,
       )),
-      'xml' => '<?xml version="1.0" encoding="utf-8" ?>
-<CaseType>
-  <name>Housing Support</name>
-  <forkable>0</forkable>
-</CaseType>
-      ',
+      'xml' => file_get_contents(__DIR__ . '/xml/forkable-0.xml'),
     );
 
     $fixtures['forkable-1'] = array(
       'json' => json_encode(array(
         'forkable' => 1,
       )),
-      'xml' => '<?xml version="1.0" encoding="utf-8" ?>
-<CaseType>
-  <name>Housing Support</name>
-  <forkable>1</forkable>
-</CaseType>
-      ',
+      'xml' => file_get_contents(__DIR__ . '/xml/forkable-1.xml'),
     );
 
     $cases = array();
diff --git a/tests/phpunit/CRM/Case/BAO/xml/empty-defn.xml b/tests/phpunit/CRM/Case/BAO/xml/empty-defn.xml
new file mode 100644 (file)
index 0000000..575aaa4
--- /dev/null
@@ -0,0 +1,4 @@
+<?xml version="1.0" encoding="utf-8" ?>
+<CaseType>
+  <name>Housing Support</name>
+</CaseType>
diff --git a/tests/phpunit/CRM/Case/BAO/xml/empty-lists.xml b/tests/phpunit/CRM/Case/BAO/xml/empty-lists.xml
new file mode 100644 (file)
index 0000000..768b6cd
--- /dev/null
@@ -0,0 +1,7 @@
+<?xml version="1.0" encoding="utf-8" ?>
+<CaseType>
+  <name>Housing Support</name>
+  <ActivityTypes></ActivityTypes>
+  <ActivitySets></ActivitySets>
+  <CaseRoles></CaseRoles>
+</CaseType>
diff --git a/tests/phpunit/CRM/Case/BAO/xml/forkable-0.xml b/tests/phpunit/CRM/Case/BAO/xml/forkable-0.xml
new file mode 100644 (file)
index 0000000..a6e6ed1
--- /dev/null
@@ -0,0 +1,5 @@
+<?xml version="1.0" encoding="utf-8" ?>
+<CaseType>
+  <name>Housing Support</name>
+  <forkable>0</forkable>
+</CaseType>
diff --git a/tests/phpunit/CRM/Case/BAO/xml/forkable-1.xml b/tests/phpunit/CRM/Case/BAO/xml/forkable-1.xml
new file mode 100644 (file)
index 0000000..e142753
--- /dev/null
@@ -0,0 +1,5 @@
+<?xml version="1.0" encoding="utf-8" ?>
+<CaseType>
+  <name>Housing Support</name>
+  <forkable>1</forkable>
+</CaseType>
diff --git a/tests/phpunit/CRM/Case/BAO/xml/one-item-in-each.xml b/tests/phpunit/CRM/Case/BAO/xml/one-item-in-each.xml
new file mode 100644 (file)
index 0000000..d5c9dbe
--- /dev/null
@@ -0,0 +1,29 @@
+<?xml version="1.0" encoding="utf-8" ?>
+<CaseType>
+  <name>Housing Support</name>
+  <ActivityTypes>
+    <ActivityType>
+      <name>First act (foréign éxamplé)</name>
+    </ActivityType>
+  </ActivityTypes>
+  <ActivitySets>
+    <ActivitySet>
+      <name>set1</name>
+      <label>Label 1</label>
+      <timeline>true</timeline>
+      <ActivityTypes>
+        <ActivityType>
+          <name>Open Case</name>
+          <status>Completed</status>
+        </ActivityType>
+      </ActivityTypes>
+    </ActivitySet>
+  </ActivitySets>
+  <CaseRoles>
+    <RelationshipType>
+      <name>First role</name>
+      <creator>1</creator>
+      <manager>1</manager>
+    </RelationshipType>
+  </CaseRoles>
+</CaseType>
diff --git a/tests/phpunit/CRM/Case/BAO/xml/two-items-in-each.xml b/tests/phpunit/CRM/Case/BAO/xml/two-items-in-each.xml
new file mode 100644 (file)
index 0000000..313c665
--- /dev/null
@@ -0,0 +1,54 @@
+<?xml version="1.0" encoding="utf-8" ?>
+<CaseType>
+  <name>Housing Support</name>
+  <ActivityTypes>
+    <ActivityType>
+      <name>First act</name>
+    </ActivityType>
+    <ActivityType>
+      <name>Second act</name>
+    </ActivityType>
+  </ActivityTypes>
+  <ActivitySets>
+    <ActivitySet>
+      <name>set1</name>
+      <label>Label 1</label>
+      <timeline>true</timeline>
+      <ActivityTypes>
+        <ActivityType>
+          <name>Open Case</name>
+          <status>Completed</status>
+        </ActivityType>
+        <ActivityType>
+          <name>Meeting</name>
+          <reference_activity>Open Case</reference_activity>
+          <reference_offset>1</reference_offset>
+          <reference_select>newest</reference_select>
+        </ActivityType>
+      </ActivityTypes>
+    </ActivitySet>
+    <ActivitySet>
+      <name>set2</name>
+      <label>Label 2</label>
+      <sequence>true</sequence>
+      <ActivityTypes>
+        <ActivityType>
+          <name>First act</name>
+        </ActivityType>
+        <ActivityType>
+          <name>Second act</name>
+        </ActivityType>
+      </ActivityTypes>
+    </ActivitySet>
+  </ActivitySets>
+  <CaseRoles>
+    <RelationshipType>
+      <name>First role</name>
+      <creator>1</creator>
+      <manager>1</manager>
+    </RelationshipType>
+    <RelationshipType>
+      <name>Second role</name>
+    </RelationshipType>
+  </CaseRoles>
+</CaseType>