Created
February 3, 2017 13:23
-
-
Save ErichBSchulz/ed1a9d9d4a24cb412e2e1d9431a9a112 to your computer and use it in GitHub Desktop.
refactor of CiviUnitTestCase
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
class TestSubjectFactory { | |
public static function testArray($params) { | |
$params = array_merge(array( | |
'overrides' => array(), | |
), $params); | |
switch ($params['entity']) { | |
case 'group': | |
$defaults = array( | |
'name' => 'Test Group 1', | |
'domain_id' => 1, | |
'title' => 'New Test Group Created', | |
'description' => 'New Test Group Created', | |
'is_active' => 1, | |
'visibility' => 'Public Pages', | |
'group_type' => array( | |
'1' => 1, | |
'2' => 1, | |
) | |
); | |
break; | |
case .... | |
etc | |
default: | |
throw new Exception('bad test entity'); | |
} | |
return array_merge($defaults, $params['overrides']); | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment