Beispiel #1
0
 public function test_getSettingsForCurrentUser_shouldReturnAllSettingsIfEnoughPermissionsAndSortThemBySettingOrder()
 {
     $this->setSuperUser();
     $this->addSystemSetting('mysystemsetting1', 'mytitle1');
     $this->addSystemSetting('mysystemsetting2', 'mytitle2');
     $this->addUserSetting('myusersetting2', 'mytitle6');
     $this->addSystemSetting('mysystemsetting3', 'mytitle3');
     $this->addSystemSetting('mysystemsetting4', 'mytitle4');
     $this->addUserSetting('myusersetting1', 'mytitle5');
     $expected = array('myusersetting2', 'myusersetting1', 'mysystemsetting1', 'mysystemsetting2', 'mysystemsetting3', 'mysystemsetting4');
     $this->assertEquals($expected, array_keys($this->settings->getSettingsForCurrentUser()));
 }
Beispiel #2
0
 public function test_getSettingsForCurrentUser_shouldReturnAllSettingsIfEnoughPermissionsAndSortThemBySettingOrder()
 {
     if (\Piwik\Tests\IntegrationTestCase::isPhpVersion53()) {
         $this->markTestSkipped('does not pass on PHP 5.3.3');
     }
     $this->setSuperUser();
     $this->addSystemSetting('mysystemsetting1', 'mytitle1');
     $this->addSystemSetting('mysystemsetting2', 'mytitle2');
     $this->addUserSetting('myusersetting2', 'mytitle6');
     $this->addSystemSetting('mysystemsetting3', 'mytitle3');
     $this->addSystemSetting('mysystemsetting4', 'mytitle4');
     $this->addUserSetting('myusersetting1', 'mytitle5');
     $expected = array('myusersetting2', 'myusersetting1', 'mysystemsetting1', 'mysystemsetting2', 'mysystemsetting3', 'mysystemsetting4');
     $this->assertEquals($expected, array_keys($this->settings->getSettingsForCurrentUser()));
 }