Exemple #1
0
 /**
  * Test comment settings
  *
  * @return void
  */
 public function testGetComment()
 {
     //first, test default configuration
     $conf = new Viewer\Conf();
     $commentParam = $conf->getComment();
     $this->boolean($commentParam)->isTrue();
 }
Exemple #2
0
    $log_dir = APP_DIR . '/logs/';
    if (defined('APP_LOGS')) {
        $log_dir = APP_LOGS;
    }
    if (!file_exists($log_dir)) {
        throw new \RuntimeException('Log directory (' . $log_dir . ') does not exists!');
    } else {
        if (!is_writeable($log_dir)) {
            throw new \RuntimeException('Log directory (' . $log_dir . ') is not writeable!');
        }
    }
    $log_file = $log_dir . 'viewer.log';
    $logger = \Analog\Handler\File::init($log_file);
}
Analog::handler(\Analog\Handler\LevelBuffer::init($logger, $log_lvl));
$conf = new Conf();
/** I18n stuff */
$lang = null;
$langs = array('en-US', 'fr-FR');
/** Try to detect user language */
if (function_exists('http_negotiate_language')) {
    $nego = http_negotiate_language($langs);
    switch (strtolower($nego)) {
        case 'en-us':
            $lang = 'en_US';
            break;
        case 'fr-fr':
            $lang = 'fr_FR.utf8';
            break;
    }
} else {
Exemple #3
0
 /**
  * Test for remote informations stuff
  *
  * @return void
  */
 public function testRemoteInfos()
 {
     $uri = Viewer\Picture::getRemoteInfosURI($this->_conf->getRemoteInfos(), null, 'tech.jpg');
     $this->string($uri)->isIdenticalTo('http://UT.bach.localhost/infosimage/tech.jpg');
     $rinfos = Viewer\Picture::getRemoteInfos($this->_conf->getRemoteInfos(), null, 'tech.jpg');
     $this->boolean($rinfos)->isFalse();
     $rinfos = Viewer\Picture::getRemoteInfos($this->_conf->getRemoteInfos(), null, 'tech.jpg', TESTS_DIR . '/data/bach_remote_infos');
     $this->string($rinfos)->isIdenticalTo('<a target="_blank" href="http://UT.bach.localhost/document/test"' . '>Test</a>' . "\n");
     $config_path = APP_DIR . '/../tests/config/config-remotepleade.yml';
     $conf = new Viewer\Conf($config_path);
     $rinfos = Viewer\Picture::getRemoteInfos($conf->getRemoteInfos(), null, 'tech.jpg');
     $this->boolean($rinfos)->isFalse();
     $rinfos = Viewer\Picture::getRemoteInfos($conf->getRemoteInfos(), null, 'tech.jpg', TESTS_DIR . '/data/pleade_remote_infos');
     $this->string($rinfos)->isIdenticalTo('<a href="http://pleade.test.localhost/ead.html?id=Test&amp;c=' . 'Test_1" title="">Test</a>');
 }