예제 #1
0
파일: treemap.php 프로젝트: xihewang/atoum
 public function testUseConfigFile()
 {
     $this->if($treemap = new testedClass(uniqid()))->and($treemap->setIncluder($includer = new \mock\atoum\includer()))->and($this->calling($includer)->includePath = function () {
     })->then->object($treemap->useConfigFile($file = uniqid()))->isIdenticalTo($treemap)->mock($includer)->call('includePath')->withArguments($file)->once()->if($this->calling($includer)->includePath->throw = new atoum\includer\exception())->then->exception(function () use($treemap, &$file) {
         $treemap->useConfigFile($file = uniqid());
     })->isInstanceOf('mageekguy\\atoum\\includer\\exception')->hasMessage('Unable to find configuration file \'' . $file . '\'');
 }
예제 #2
0
파일: treemap.php 프로젝트: xihewang/atoum
<?php

use mageekguy\atoum, mageekguy\atoum\scripts;
require_once __DIR__ . '/../constants.php';
require_once __DIR__ . '/../classes/autoloader.php';
$treemap = new scripts\treemap(__FILE__);
set_error_handler(function ($error, $message, $file, $line) use($treemap) {
    if (error_reporting() !== 0) {
        $treemap->writeError($message);
        exit($error);
    }
});
try {
    $treemap->setHtmlDirectory(atoum\directory . '/resources/treemap')->run();
} catch (\exception $exception) {
    $treemap->writeError($exception->getMessage());
    exit($exception->getCode());
}
exit(0);