コード例 #1
0
 public function testDelete()
 {
     $env = new \Test\Tool\ModuleTestEnvironment();
     $env->setArguments(array('delete'));
     $env->setRequest(array('delete' => array('address' => '10.0.0.0')));
     $cs = new \Test\Tool\MockState();
     $cs->set(\Test\Tool\DB::getProp('httpd-admin', 'ValidFrom'), '192.168.1.0/255.255.255.0,10.0.0.0/255.128.0.0')->transition(\Test\Tool\DB::setProp('httpd-admin', 'ValidFrom', '192.168.1.0/255.255.255.0'), TRUE)->setFinal();
     $env->setDatabase('configuration', $cs);
     $env->setEvents(array('remoteaccess-update'));
     $this->runModuleTest($this->object, $env);
 }
コード例 #2
0
 public function testSetFinal()
 {
     $this->object->setFinal();
     $this->assertTrue($this->object->isFinal());
 }
コード例 #3
0
ファイル: FtpTest.php プロジェクト: sitz-air/nethserver-base
 public function testDisablePassword()
 {
     $env = new \Test\Tool\ModuleTestEnvironment();
     $env->setRequest(array('status' => 'anyNetwork', 'acceptPasswordFromAnyNetwork' => ''));
     $env->setView(array('status' => 'anyNetwork', 'acceptPasswordFromAnyNetwork' => ''));
     $cs = new \Test\Tool\MockState();
     $cs->set(DB::getProp('ftp', 'status'), 'enabled');
     $cs->set(DB::getProp('ftp', 'LoginAccess'), 'public');
     $cs->set(DB::getProp('ftp', 'access'), 'public');
     $cs->transition(DB::setProp('ftp', 'access', 'private'), TRUE)->setFinal();
     $env->setDatabase('configuration', $cs);
     $env->setEvents(array('remoteaccess-update'));
     $this->runModuleTest($this->object, $env);
 }