public function setUp() { parent::setUp(); $this->loader = $this->di->getLoader(); $strModule = 'App\\Modules\\Api'; $strModuleDir = $this->di->getConfig()->application->modulesDir . DIRECTORY_SEPARATOR . 'api'; $this->loader->registerNamespaces(array($strModule => $strModuleDir), true); $this->module = new Module(); }
public function setUp() { parent::setUp(); $this->router = new Router(); $this->router->add('/api/web/v1/:controller', array('module' => 'api', 'action' => 'index', 'controller' => 1))->setName('single_controller'); $this->router->add('/api/web/v{version}', array('module' => 'api', 'action' => 'index', 'controller' => 'index'))->setName('simple_version'); $this->router->add('/api/web/v{major:[0-9]{1,2}}\\.{minor:[0-9]{1,2}}', array('module' => 'api', 'action' => 'index', 'controller' => 'index'))->setName('syntax_version'); $this->router->add('/api/web/v{major:[0-9]{1,2}}\\.{minor:[0-9]{1,2}}/:controller/:action', array('module' => 'api', 'action' => 4, 'controller' => 3))->setName('syntax_version_action_controller'); $this->router->add('/api/mobile/v{major:[0-9]{1,2}}\\.{minor:[0-9]{1,2}}/:controller/:action/:params', array('module' => 'api', 'action' => 4, 'controller' => 3, 'params' => 5))->setName('syntax_version_action_controller_parameters'); $this->router->add('/api/mobile/v{major:[0-9]{1,2}}\\.{minor:[0-9]{1,2}}/:controller/:action/:int', array('module' => 'api', 'action' => 4, 'controller' => 3, 'id' => 5))->setName('syntax_version_action_controller_id'); $this->router->add('/api/{media}/v{major:[0-9]{1,2}}\\.{minor:[0-9]{1,2}}/:controller/:action/:int', array('module' => 'api', 'action' => 5, 'controller' => 4, 'id' => 6))->setName('media_syntax_version_action_controller_id'); $arRoutes = $this->router->getRoutes(); /** * @type Router\Route $oRoute */ foreach ($arRoutes as $oRoute) { $this->routes[] = $oRoute->getPattern(); } }
/** * 初期化 */ public function setUp() { parent::setUp(); $this->obj = new \App\fb\FizzBuzz(); }
public function tearDown() { $this->router->clear(); parent::tearDown(); }
public function setUp() { parent::setUp(); $this->obj = new \App\fb\screamer\Fizz(); }