예제 #1
0
    /**
     * Тест установки sitemap-индекса к конфигу  
     */
    public function testSelectControlNames()
    {
        SystemRegisterSample::clearCache();
        $fileList = \DAO_FileSystem::getInstance()->getFileList(LIB_PATH . 'custom_config/controls/');
        $list = CConfigControlManager::selectAll();
        $this->assertEquals(sizeof($fileList), sizeof($list));
        // Добавляем в реестр файлег, но не пишем класс
        $path = LIB_PATH . 'custom_config/test.php';
        $register = new SystemRegister('Applications/cconfig/user_control_path');
        $register->insert('test', $path, '');
        file_put_contents($path, '');
        $list = CConfigControlManager::selectAll();
        $this->assertEquals(sizeof($fileList), sizeof($list));
        // Заполняем инфо о классе, таким образом класс становится доступным
        $path = 'custom_config/test2.php';
        $contents = <<<EOD
<?
class CConfigControl_Test2 extends CConfigBaseControl {
\tpublic function getXType() {
\t\treturn "test2";
\t}
}
?>
EOD;
        file_put_contents(LIB_PATH . $path, $contents);
        $register->insert('test2', $path, '');
        $list = CConfigControlManager::selectAll();
        $this->assertEquals(sizeof($fileList) + 1, sizeof($list));
    }
예제 #2
0
파일: mainTest.php 프로젝트: gudwin/extasy
 /**
  * Очищаем системный реестр
  */
 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);
 }
예제 #3
0
<?php

$register = new SystemRegister('System/CMS');
$register->delete('display_administrate_scripts');
SystemRegisterSample::clearCache();
예제 #4
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));
 }
예제 #5
0
파일: base.php 프로젝트: gudwin/extasy
 public function tearDown()
 {
     SystemRegisterSample::clearCache();
     \Extasy\tests\system_register\Restorator::restore();
 }