Ejemplo n.º 1
0
 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 . '\'');
 }
Ejemplo n.º 2
0
<?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);