Exemplo n.º 1
0
 /**
  * Очищаем системный реестр
  */
 protected function clearSystemRegister()
 {
     SystemRegisterSample::clearCache();
     $register = new SystemRegister('Applications/cconfig');
     $register->delete('user_control_path');
     SystemRegisterSample::clearCache();
     $register->insert('user_control_path', null, '', SYSTEMREGISTER_BRANCH_TYPE);
 }
Exemplo n.º 2
0
 /**
  * Тестирование удаления элементов
  */
 public function testDelete()
 {
     $register = new SystemRegister('/AppData');
     //
     $register->delete('test1/value1');
     //
     try {
         $szValue = $register->test1->value1->value;
         $this->Fail('Property must be deleted');
     } catch (SystemRegisterException $e) {
     }
 }
Exemplo n.º 3
0
 /**
  * Проверяем удаляется ли из кеша
  * @expectedException SystemRegisterException
  */
 public function testCacheOnDeletedItem()
 {
     $register = new SystemRegister();
     $register->insert('AppData/test1/new_value', 'New Value');
     //
     $szValue = $register->get('AppData/test1/new_value');
     //
     $test1 = $register->get('AppData/test1');
     $register->delete('AppData/test1/new_value');
     //
     $test1->get('new_value');
 }
Exemplo n.º 4
0
 public function tearDown()
 {
     $path = array(LIB_PATH . 'custom_config/controls/failed_to_load.php', LIB_PATH . 'custom_config/test.php', LIB_PATH . 'custom_config/test2.php');
     foreach ($path as $row) {
         if (file_exists($row)) {
             unlink($row);
         }
     }
     $register = new SystemRegister('Applications/cconfig/user_control_path');
     $child = SystemRegisterSample::selectChild($register->getId());
     foreach ($child as $row) {
         $register->delete($row['name']);
     }
 }
Exemplo n.º 5
0
<?php

$register = new SystemRegister('System/CMS');
$register->delete('display_administrate_scripts');
SystemRegisterSample::clearCache();
Exemplo n.º 6
0
<?php

namespace Extasy\tests\Audit;

use Faid\DBSimple;
use Extasy\tests\Helper as TestsHelper;
use UserAccount;
use ACL;
use Extasy\Audit\Api\ApiOperation;
use Extasy\Audit\Record;
use Extasy\Audit\Log;
use Extasy\tests\system_register\Restorator;
use Extasy\Columns\Password as passwordColumn;
$register = new \SystemRegister('/System/');
try {
    $register->delete('Audit');
} catch (\Exception $e) {
}
Restorator::restore();
\SystemRegisterSample::createCache();
TestsHelper::dbFixture(ACL_TABLE, array());
ACL::create(ApiOperation::RightName);
// user record
TestsHelper::dbFixture(USERS_TABLE, array(array('login' => 'login', 'password' => passwordColumn::hash('testtest')), array('login' => 'guest', 'password' => passwordColumn::hash('testtest'))));
// grant user permission
$user = UserAccount::getByLogin('login');
ACL::grant(ApiOperation::RightName, $user->obj_rights->getEntity());
\UsersLogin::login('login', 'testtest');
// base logs
TestsHelper::dbFixture(Log::getTableName(), array(array('name' => 'Log1', 'critical' => 0, 'enable_logging' => 1), array('name' => 'Log2', 'critical' => 1, 'enable_logging' => 1)));
// base records
Exemplo n.º 7
0
 public function testImportUpdatingFileCacheWithDeletion()
 {
     $system = new SystemRegister('/System/');
     $this->assertEquals(false, isset($system->array));
     SystemRegisterHelper::import($system, array('XX' => '1', 'yy' => '2', 'Gisma' => 'rulit!', 'array' => array('0' => 'value1', '1' => array('1' => '2', '3' => '4'))));
     $this->assertEquals(true, isset($system->array));
     //
     SystemRegisterSample::loadAll();
     $base = new SystemRegister('System');
     $this->assertEquals(true, isset($system->array));
     $base->delete('array');
     $this->assertEquals(false, isset($base->array));
     //
     SystemRegisterSample::clearCache();
     SystemRegisterSample::loadAll();
     $system = new SystemRegister('/System/');
     $this->assertEquals(false, isset($base->array));
 }
Exemplo n.º 8
0
<?php

$register = new SystemRegister('/System/CMS');
$register->delete('Menu');
$register->delete('routes');
SystemRegisterSample::createCache();