/**
  * Test createAuthUserFile().
  */
 public function testCreateAuthUserFile()
 {
     $fs = new Filesystem();
     $fs->mkdir(sys_get_temp_dir() . '/conf');
     $domain = new Domain();
     $protection = new Protection($domain);
     $protectionuser = new ProtectionUser($domain, $protection);
     $domain->setPath(sys_get_temp_dir());
     $protection->setId(1)->setProtectionuser(new ArrayCollection(array($protectionuser)));
     $protectionuser->setUsername('test')->setPassword('tester')->setProtection($protection);
     $this->getService()->createAuthUserFile($protection);
     $this->assertFileExists(sys_get_temp_dir() . '/conf/authuser_1.passwd');
 }