3 +--------------------------------------------------------------------+
4 | Copyright CiviCRM LLC. All rights reserved. |
6 | This work is published under the GNU AGPLv3 license with some |
7 | permitted exceptions and without any warranty. For full license |
8 | and copyright information, see https://civicrm.org/licensing |
9 +--------------------------------------------------------------------+
15 class CRM_Contact_Form_Task_UseraddTest
extends CiviUnitTestCase
{
18 * Test postProcess failure.
20 * In unit tests, the CMS user creation will always fail, but that's
21 * ok because that's what we're testing here.
23 public function testUserCreateFail() {
24 $form = new CRM_Contact_Form_Task_Useradd();
25 // We don't need to set params or anything because we're testing fail,
26 // which the user creation will do in unit tests no matter what we set.
27 // But before the patch, the status messages were always success no
32 catch (CRM_Core_Exception_PrematureExitException
$e) {
34 $statuses = CRM_Core_Session
::singleton()->getStatus(TRUE);
35 $this->assertEquals('alert', $statuses[0]['type']);