Merge pull request #7680 from JMAConsulting/CRM-16259-9
[civicrm-core.git] / tests / phpunit / CRM / Core / RegionTest.php
index a9dfb8467ad21270604a12664e5977cc0e7dae81..121129862f6ca2855f7413c0ad31df243fb3afc3 100644 (file)
@@ -1,9 +1,8 @@
 <?php
 
-require_once 'CiviTest/CiviUnitTestCase.php';
-
 /**
  * Class CRM_Core_RegionTest
+ * @group headless
  */
 class CRM_Core_RegionTest extends CiviUnitTestCase {
   public function setUp() {
@@ -13,7 +12,7 @@ class CRM_Core_RegionTest extends CiviUnitTestCase {
 
     // Templates injected into regions should normally be file names, but for unit-testing it's handy to use "string:" notation
     require_once 'CRM/Core/Smarty/resources/String.php';
-    civicrm_smarty_register_string_resource( );
+    civicrm_smarty_register_string_resource();
   }
 
   /**
@@ -43,7 +42,7 @@ class CRM_Core_RegionTest extends CiviUnitTestCase {
    */
   public function testOverride() {
     CRM_Core_Region::instance('testOverride')->update('default', array(
-       'disabled' => TRUE,
+      'disabled' => TRUE,
     ));
     CRM_Core_Region::instance('testOverride')->add(array(
       'markup' => 'override<br/>',
@@ -56,7 +55,7 @@ class CRM_Core_RegionTest extends CiviUnitTestCase {
   }
 
   /**
-   * Test that each of the major content formats are correctly evaluated
+   * Test that each of the major content formats are correctly evaluated.
    */
   public function testAllTypes() {
     CRM_Core_Region::instance('testAllTypes')->add(array(
@@ -70,15 +69,15 @@ class CRM_Core_RegionTest extends CiviUnitTestCase {
     CRM_Core_Region::instance('testAllTypes')->add(array(
       // note: returns a value which gets appended to the region
       'callback' => 'implode',
-      'arguments' => array('-', array('callback','with','specific','args<br/>')),
+      'arguments' => array('-', array('callback', 'with', 'specific', 'args<br/>')),
     ));
     CRM_Core_Region::instance('testAllTypes')->add(array(
       // note: returns a value which gets appended to the region
-      'callback' => create_function('&$spec, &$html', 'return "callback-return<br/>";')
+      'callback' => create_function('&$spec, &$html', 'return "callback-return<br/>";'),
     ));
     CRM_Core_Region::instance('testAllTypes')->add(array(
       // note: returns void; directly modifies region's $html
-      'callback' => create_function('&$spec, &$html', '$html = "callback-ref<br/>" . $html;')
+      'callback' => create_function('&$spec, &$html', '$html = "callback-ref<br/>" . $html;'),
     ));
     CRM_Core_Region::instance('testAllTypes')->add(array(
       'scriptUrl' => '/foo%20bar.js',
@@ -108,8 +107,7 @@ class CRM_Core_RegionTest extends CiviUnitTestCase {
       . "<script type=\"text/javascript\">\nalert(\"hi\");\n</script>\n"
       . "<script type=\"text/javascript\">\nCRM.\$(function(\$) {\n\$(\"div\");\n});\n</script>\n"
       . "<link href=\"/foo%20bar.css\" rel=\"stylesheet\" type=\"text/css\"/>\n"
-      . "<style type=\"text/css\">\nbody { background: black; }\n</style>\n"
-      ;
+      . "<style type=\"text/css\">\nbody { background: black; }\n</style>\n";
     $this->assertEquals($expected, $actual);
   }