/**
  * test if a valid mail result in a successful mail send
  */
 public function testCreateSuccessfulWithValidEMail()
 {
     /**
      * FIXME: Disabled due to missing DI on mail class.
      * TODO: Re-enable when https://github.com/owncloud/core/pull/12085 is merged.
      */
     $this->markTestSkipped('Disable test until OC_Mail is rewritten.');
     $this->container['Mail']->expects($this->once())->method('validateAddress')->will($this->returnValue(true));
     $this->container['Mail']->expects($this->once())->method('send')->with($this->equalTo('*****@*****.**'), $this->equalTo('foo'), $this->anything(), $this->anything(), $this->anything(), $this->equalTo('*****@*****.**'), $this->equalTo(1), $this->anything());
     $this->container['Logger']->expects($this->never())->method('error');
     $response = $this->usersController->create('foo', 'password', array(), '*****@*****.**');
     $this->assertEquals(Http::STATUS_CREATED, $response->getStatus());
 }
 public function __construct($appName, IRequest $request, IUserManager $userManager, IGroupManager $groupManager, IUserSession $userSession, IConfig $config, $isAdmin, IL10N $l10n, ILogger $log, \OC_Defaults $defaults, IMailer $mailer, $fromMailAddress, IURLGenerator $urlGenerator, IAppManager $appManager, SubAdminFactory $subAdminFactory)
 {
     parent::__construct($appName, $request, $userManager, $groupManager, $userSession, $config, $isAdmin, $l10n, $log, $defaults, $mailer, $fromMailAddress, $urlGenerator, $appManager, $subAdminFactory);
     $this->userManager = $userManager;
     $this->groupManager = $groupManager;
     $this->userSession = $userSession;
     $this->config = $config;
     $this->isAdmin = $isAdmin;
     $this->l10n = $l10n;
     $this->log = $log;
     $this->defaults = $defaults;
     $this->mailer = $mailer;
     $this->fromMailAddress = $fromMailAddress;
     $this->urlGenerator = $urlGenerator;
     $this->subAdminFactory = $subAdminFactory;
     // check for encryption state - TODO see formatUserForIndex
     $this->isEncryptionAppEnabled = $appManager->isEnabledForUser('encryption');
     if ($this->isEncryptionAppEnabled) {
         // putting this directly in empty is possible in PHP 5.5+
         $result = $config->getAppValue('encryption', 'recoveryAdminEnabled', 0);
         $this->isRestoreEnabled = !empty($result);
     }
 }