Ejemplo n.º 1
0
<?php

require_once dirname(__FILE__) . '/../bootstrap/unit.php';
require_once dirname(__FILE__) . '/../../apps/core/modules/kernel/lib/KernelInstance.class.php';
require_once dirname(__FILE__) . '/../../apps/core/modules/kernel/lib/KernelProperties.class.php';
$t = new lime_test(35);
$instance = new KernelInstance(null, null);
/*-----------------------------------------------------------F20601-----------------------------------------------------------*/
//F20601-T01:
$instance->addLog('info', 'test_info_1');
$t->is(file_exists(ProjectConfiguration::guessRootDir() . '/log/info.log'), true, 'TEST OF: KernelInstance::addLog method');
unlink(ProjectConfiguration::guessRootDir() . '/log/info.log');
//F20601-T02:
$instance->addLog('', 'test_info_1');
$t->is(file_exists(ProjectConfiguration::guessRootDir() . '/log/info.log'), false, 'TEST OF: KernelInstance::addLog method');
//F20601-T03:
$instance->addLog(null, 'test_info_1');
$t->is(file_exists(ProjectConfiguration::guessRootDir() . '/log/info.log'), false, 'TEST OF: KernelInstance::addLog method');
//F20601-T04:
$instance->addLog('info', '');
$t->is(file_exists(ProjectConfiguration::guessRootDir() . '/log/info.log'), false, 'TEST OF: KernelInstance::addLog method');
//F20601-T05:
$instance->addLog('info', null);
$t->is(file_exists(ProjectConfiguration::guessRootDir() . '/log/info.log'), false, 'TEST OF: KernelInstance::addLog method');
/*-----------------------------------------------------------F20602-----------------------------------------------------------*/
//F20602-T01:
$array = array('info' => 'test_info', 'info' => 'test_info2', 'info' => 'test_info3');
$instance->addMultipleLog($array);
$t->is(file_exists(ProjectConfiguration::guessRootDir() . '/log/info.log'), true, 'TEST OF: KernelInstance::addLog method');
unlink(ProjectConfiguration::guessRootDir() . '/log/info.log');
//F20602-T02:
Ejemplo n.º 2
0
 /**
  * 
  * @param array $dep_table
  * @param string $module
  */
 public static function hasUnsatisfiedDependencies($dep_table, $module)
 {
     foreach ($dep_table as $mod => $dep_list) {
         foreach ($dep_list as $dep) {
             if (KernelInstance::isUnsatisfied($module, $dep)) {
                 return true;
             }
         }
     }
     return false;
 }