/** * @expectedException \Fortissimo\RequestNotFoundException */ public function testRequestNotFound() { // We don't want FOIL logger, so we create // a registry froms scratch. $registry = new \Fortissimo\Registry(__CLASS__); $registry->route('default')->does('\\Fortissimo\\Command\\EchoText', 'echo')->using('text', 'TEST'); global $argv; $runner = new CLIRunner($argv, STDOUT, STDIN); $runner->useRegistry($registry)->run('noSuchRequest'); }
public function __construct($file = NULL) { if (isset($file)) { \Fortissimo\Registry::initialize(); } parent::__construct($file); }
public function setUp() { Registry::initialize(); }
*/ require_once FORT_APP_PATH . '/vendor/autoload.php'; use Symfony\Component\Finder\Finder; use Symfony\Component\Finder\Adapter\PhpAdapter; use Fortissimo\CLI\Runtime\Runner; use Fortissimo\Registry; use Fortissimo\CLI\IO\BasicOutput; use Fortissimo\CLI\IO\BasicPrompt; global $argv; $target = \Fortissimo\CLI\ParseOptions::getFirstArgument($argv); if (empty($target)) { $target = 'help'; } // Build the registry. The name of the registry should be changed to a name for // the application. $registry = new Registry('fort-application'); // Adding prompts (input) and output. $output = new BasicOutput(); $prompt = new BasicPrompt($output); $registry->datasource(function () use($output) { return $output; }, 'output'); $registry->datasource(function () use($prompt) { return $prompt; }, 'prompt'); // The output injection logger puts any log messages into the buffer. Think of // this like using print or echo. $registry->logger('\\Fortissimo\\Logger\\OutputInjectionLogger', 'foil'); // Load all of the configuration files. They are loaded in alpha order. $iterator = Finder::create()->files()->name('*.php')->in(array(FORT_APP_PATH . '/config')); // Because this iterator may be used in a Phar file we want to specify the PhpAdapter.
<?php /** * @file * The default registry for Fortissimo. * * DO NOT MODIFY. Your application should declare its own registry. */ use Fortissimo\Registry; $register = new Registry('Fortissimo'); $register->route('@test');