protected function setUp() { $this->module = new \NethServer\Module\User(); $this->env = new \Test\Tool\ModuleTestEnvironment(); $ldapKey = array('defaultCity' => 'Pesaro', 'defaultPhoneNumber' => '1234', 'defaultDepartment' => 'Sviluppo', 'defaultCompany' => 'Nethesis', 'defaultStreet' => 'Via degli Olmi'); $groups = array('g1' => array('type' => 'group', 'Description' => 'Group1', 'Members' => 'u1,u2,u3'), 'g2' => array('type' => 'group', 'Description' => 'Group2', 'Members' => 'u3,u2')); $users = array('u1' => array('type' => 'user', 'FirstName' => 'Utente1', 'LastName' => 'Test1'), 'u2' => array('type' => 'user', 'FirstName' => 'Utente2', 'LastName' => 'Test2'), 'u3' => array('type' => 'user', 'FirstName' => 'Utente3', 'LastName' => 'Test3')); $cs = new \Test\Tool\DB(); $cs->set($cs::getKey('ldap'), $ldapKey); $this->env->setDatabase('configuration', $cs); $ac = new \Test\Tool\DB(); $ac->set($ac::getAll('group'), $groups); $ac->set($ac::getProp('g1', 'Members'), $groups['g1']['Members']); $ac->set($ac::getProp('g2', 'Members'), $groups['g2']['Members']); $ac->set($ac::getAll('user'), $users); $this->env->setDatabase('accounts', $ac); }
/** * @dataProvider environmentProvider */ public function testChangeDate(\Test\Tool\ModuleTestEnvironment $env) { $cs = new \Test\Tool\DB(); $cs->set($cs::getType('TimeZone'), 'Europe/Rome'); $cs->set($cs::getProp('ntpd', 'NTPServer'), ''); $cs->set($cs::getProp('ntpd', 'status'), 'disabled'); $cs->setFinal(); $env->setDatabase('configuration', $cs); $env->setRequest(array('status' => 'disabled', 'timezone' => 'Europe/Rome', 'date' => '2011-01-31', 'time' => '13:04')); $env->setView(array('date' => '2011-01-31', 'time' => '13:04')); $env->setEvents(array(array('time-manual-update', array('013113042011.00')))); $this->runModuleTest($this->object, $env); }