4 * Class CRM_Utils_SystemTest
6 class CRM_Utils_SystemTest
extends CiviUnitTestCase
{
8 public function setUp() {
12 public function testUrlQueryString() {
13 $config = CRM_Core_Config
::singleton();
14 $this->assertTrue($config->userSystem
instanceof CRM_Utils_System_UnitTests
);
15 $expected = '/index.php?q=civicrm/foo/bar&foo=ab&bar=cd%26ef';
16 $actual = CRM_Utils_System
::url('civicrm/foo/bar', 'foo=ab&bar=cd%26ef', FALSE, NULL, FALSE);
17 $this->assertEquals($expected, $actual);
20 public function testUrlQueryArray() {
21 $config = CRM_Core_Config
::singleton();
22 $this->assertTrue($config->userSystem
instanceof CRM_Utils_System_UnitTests
);
23 $expected = '/index.php?q=civicrm/foo/bar&foo=ab&bar=cd%26ef';
24 $actual = CRM_Utils_System
::url('civicrm/foo/bar', array(
27 ), FALSE, NULL, FALSE);
28 $this->assertEquals($expected, $actual);
31 public function testEvalUrl() {
32 $this->assertEquals(FALSE, CRM_Utils_System
::evalUrl(FALSE));
33 $this->assertEquals('http://example.com/', CRM_Utils_System
::evalUrl('http://example.com/'));
34 $this->assertEquals('http://example.com/?cms=UnitTests', CRM_Utils_System
::evalUrl('http://example.com/?cms={uf}'));