Ejemplo n.º 1
0
 public function preparePathRegexp_PathWithNamedParameter_ReturnsRegExp()
 {
     // arrange
     $app = new App(self::VALID_APP_NAME);
     // act
     $regexp = $app->preparePathRegexp('/multi/path/:arg/path');
     // assert
     Assert::areEqual($regexp, "/^\\/multi\\/path\\/(?P<arg>[^\\/]+)\\/path\$/");
 }
Ejemplo n.º 2
0
 public function Constructor_ValidName_NewModule()
 {
     // arrange
     // act
     $module = new Module(self::VALID_MODULE_NAME);
     // assert
     Assert::areEqual($module->name, self::VALID_MODULE_NAME);
     Assert::areSame($module->modules, []);
     Assert::areSame($module->factories, []);
     Assert::areSame($module->endpoints, ['GET' => [], 'POST' => [], 'PUT' => [], 'DELETE' => []]);
 }