<?php
-require_once 'CiviTest/CiviUnitTestCase.php';
-
/**
* Class CRM_Core_RegionTest
+ * @group headless
*/
class CRM_Core_RegionTest extends CiviUnitTestCase {
public function setUp() {
// 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();
}
/**
*/
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/>',
}
/**
- * 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(
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',
. "<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);
}