File tree Expand file tree Collapse file tree 4 files changed +65
-1
lines changed
specs/issue_fix/84_how_to_generate_controller_code_with_distinct_method_names_in_case_of_prefix_in_paths/app Expand file tree Collapse file tree 4 files changed +65
-1
lines changed Original file line number Diff line number Diff line change
1
+ <?php
2
+ /**
3
+ * OpenAPI UrlRules
4
+ *
5
+ * This file is auto generated.
6
+ */
7
+ return [
8
+ 'GET calendar/domains ' => 'calendar/domains ' ,
9
+ 'GET calendar/domains/<id:\d+> ' => 'calendar/domains ' ,
10
+ 'calendar/domains ' => 'calendar/options ' ,
11
+ 'calendar/domains/<id:\d+> ' => 'calendar/options ' ,
12
+ ];
Original file line number Diff line number Diff line change
1
+ <?php
2
+
3
+ namespace app \controllers ;
4
+
5
+ class CalendarController extends \app \controllers \base \CalendarController
6
+ {
7
+
8
+ public function checkAccess ($ action , $ model = null , $ params = [])
9
+ {
10
+ //TODO implement checkAccess
11
+ }
12
+
13
+ public function actionDomains ()
14
+ {
15
+ //TODO implement actionDomains
16
+ }
17
+
18
+
19
+ }
20
+
Original file line number Diff line number Diff line change
1
+ <?php
2
+
3
+ namespace app \controllers \base ;
4
+
5
+ abstract class CalendarController extends \yii \rest \Controller
6
+ {
7
+ public function actions ()
8
+ {
9
+ return [
10
+ 'options ' => [
11
+ 'class ' => \yii \rest \OptionsAction::class,
12
+ ],
13
+ ];
14
+ }
15
+
16
+ /**
17
+ * Checks the privilege of the current user.
18
+ *
19
+ * This method checks whether the current user has the privilege
20
+ * to run the specified action against the specified data model.
21
+ * If the user does not have access, a [[ForbiddenHttpException]] should be thrown.
22
+ *
23
+ * @param string $action the ID of the action to be executed
24
+ * @param object $model the model to be accessed. If null, it means no specific model is being accessed.
25
+ * @param array $params additional parameters
26
+ * @throws \yii\web\ForbiddenHttpException if the user does not have access
27
+ */
28
+ abstract public function checkAccess ($ action , $ model = null , $ params = []);
29
+
30
+ abstract public function actionDomains ();
31
+
32
+ }
Original file line number Diff line number Diff line change @@ -386,6 +386,6 @@ public function test84HowToGenerateControllerCodeWithDistinctMethodNamesInCaseOf
386
386
$ expectedFiles = FileHelper::findFiles (Yii::getAlias ("@specs/issue_fix/84_how_to_generate_controller_code_with_distinct_method_names_in_case_of_prefix_in_paths/app " ), [
387
387
'recursive ' => true ,
388
388
]);
389
- // $this->checkFiles($actualFiles, $expectedFiles); // TODO
389
+ $ this ->checkFiles ($ actualFiles , $ expectedFiles );
390
390
}
391
391
}
You can’t perform that action at this time.
0 commit comments