user = SugarTestUserUtilities::createAnonymousUser(); } public function userTypes() { return array( array('is_admin' => '1', 'is_group' => '0', 'portal_only' => '0', 'type' => 'Administrator'), array('is_admin' => '0', 'is_group' => '1', 'portal_only' => '0', 'type' => 'GROUP'), array('is_admin' => '0', 'is_group' => '0', 'portal_only' => '0', 'type' => 'RegularUser') ); } /** * @group 49175 * @dataProvider userTypes */ public function testGetUserType($is_admin, $is_group, $portal_only=0, $type) { $this->user->is_admin = $is_admin; $this->user->is_group = $is_group; $userViewHelper = new MockUserViewHelper(); $userViewHelper->setUserType($this->user); $this->assertEquals($this->user->user_type, $type); } } class MockUserViewHelper extends UserViewHelper { //override the constructor, don't bother passing Smarty instance, etc. public function __construct() { } } ?>