Skip to content

Commit 8dd401b

Browse files
committed
Complete the test
1 parent 60d0b1e commit 8dd401b

File tree

4 files changed

+65
-1
lines changed

4 files changed

+65
-1
lines changed
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
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 numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
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 numberDiff line numberDiff line change
@@ -0,0 +1,32 @@
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+
}

tests/unit/IssueFixTest.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -386,6 +386,6 @@ public function test84HowToGenerateControllerCodeWithDistinctMethodNamesInCaseOf
386386
$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"), [
387387
'recursive' => true,
388388
]);
389-
// $this->checkFiles($actualFiles, $expectedFiles); // TODO
389+
$this->checkFiles($actualFiles, $expectedFiles);
390390
}
391391
}

0 commit comments

Comments
 (0)