Skip to content
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
Show all changes
30 commits
Select commit Hold shift + click to select a range
cbb5adb
Create PR
SOHELAHMED7 Feb 12, 2025
ca8e804
Add passing test
SOHELAHMED7 Feb 14, 2025
b050abd
Failing test
SOHELAHMED7 Mar 1, 2025
45f3f90
Fix
SOHELAHMED7 Mar 1, 2025
e69fc04
Fix failing tests
SOHELAHMED7 Mar 3, 2025
ab6629b
Create PR
SOHELAHMED7 Mar 3, 2025
207228b
Add test stub
SOHELAHMED7 Mar 3, 2025
4c409f7
WIP
SOHELAHMED7 Mar 4, 2025
2eda480
Refactor
SOHELAHMED7 Mar 4, 2025
1231531
Refactor 2
SOHELAHMED7 Mar 4, 2025
d93d0b3
Merge branch '88-in-case-of-updating-a-model-generator-creates-redund…
SOHELAHMED7 Mar 4, 2025
a69f43a
Implement
SOHELAHMED7 Mar 4, 2025
f92b782
Complete the test
SOHELAHMED7 Mar 4, 2025
5b1ec54
Fix failing tests
SOHELAHMED7 Mar 4, 2025
2134ddf
Refactor and add docs
SOHELAHMED7 Mar 4, 2025
426fecb
Modify a file to create pull request at GitHub
SOHELAHMED7 Mar 7, 2025
49cd50e
Add message
SOHELAHMED7 Mar 7, 2025
ecbee94
Complete the test
SOHELAHMED7 Mar 7, 2025
229c003
Refactor
SOHELAHMED7 Mar 8, 2025
d89fe28
Refactor and fix failing test
SOHELAHMED7 Mar 8, 2025
4aa7668
Fix
SOHELAHMED7 Mar 8, 2025
24d559a
Merge branches 'master' and '96-component-schema-should-be-optional' …
SOHELAHMED7 Mar 12, 2025
95670f5
Merge branch 'master' of github.com:php-openapi/yii2-openapi into 79-…
SOHELAHMED7 Mar 12, 2025
c4c9467
Merge branch 'master' of github.com:php-openapi/yii2-openapi into 90-…
SOHELAHMED7 Mar 12, 2025
ca1e12a
Merge branch 'master' of github.com:php-openapi/yii2-openapi into 88-…
SOHELAHMED7 Mar 12, 2025
856e1d6
Merge branches 'master' and '96-component-schema-should-be-optional' …
SOHELAHMED7 Mar 12, 2025
f83bbd4
Merge branch '79-response-status-codes-are-not-the-codes-defined-in-s…
SOHELAHMED7 Mar 12, 2025
8921fed
Merge branch '88-in-case-of-updating-a-model-generator-creates-redund…
SOHELAHMED7 Mar 12, 2025
dd34cdb
Merge branch '78-properties-that-are-marked-as-readonly-are-not-read-…
SOHELAHMED7 Mar 12, 2025
4d32a93
Merge branch '90-implement-belongs-to-relations-in-models' of github.…
SOHELAHMED7 Mar 12, 2025
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
Complete the test
  • Loading branch information
SOHELAHMED7 committed Mar 7, 2025
commit ecbee9432dc6581367e0983c338be3656d125af1
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
<?php

namespace app\controllers;

class MangoController extends \app\controllers\base\MangoController
{

public function checkAccess($action, $model = null, $params = [])
{
//TODO implement checkAccess
}

public function actionCake()
{
// TODO implement actionCake
// In order to conform with OpenAPI spec, response of this action must have one of the following HTTP status code: 200, 403, 404
}

public function actionCreateCake()
{
// TODO implement actionCreateCake
// In order to conform with OpenAPI spec, response of this action must have one of the following HTTP status code: 201, 403, 404, 422
}


}

Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
<?php

namespace app\controllers\base;

abstract class MangoController extends \yii\rest\Controller
{
public function actions()
{
return [
'options' => [
'class' => \yii\rest\OptionsAction::class,
],
];
}

/**
* Checks the privilege of the current user.
*
* This method checks whether the current user has the privilege
* to run the specified action against the specified data model.
* If the user does not have access, a [[ForbiddenHttpException]] should be thrown.
*
* @param string $action the ID of the action to be executed
* @param object $model the model to be accessed. If null, it means no specific model is being accessed.
* @param array $params additional parameters
* @throws \yii\web\ForbiddenHttpException if the user does not have access
*/
abstract public function checkAccess($action, $model = null, $params = []);

abstract public function actionCake();

abstract public function actionCreateCake();

}
14 changes: 7 additions & 7 deletions tests/unit/IssueFixTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -1020,12 +1020,12 @@ public function test79ResponseStatusCodesAreNotTheCodesDefinedInSpec()
{
$testFile = Yii::getAlias("@specs/issue_fix/79_response_status_codes_are_not_the_codes_defined_in_spec/index.php");
$this->runGenerator($testFile);
// $actualFiles = FileHelper::findFiles(Yii::getAlias('@app'), [
// 'recursive' => true,
// ]);
// $expectedFiles = FileHelper::findFiles(Yii::getAlias("@specs/issue_fix/79_response_status_codes_are_not_the_codes_defined_in_spec/mysql"), [
// 'recursive' => true,
// ]);
// $this->checkFiles($actualFiles, $expectedFiles);
$actualFiles = FileHelper::findFiles(Yii::getAlias('@app'), [
'recursive' => true,
]);
$expectedFiles = FileHelper::findFiles(Yii::getAlias("@specs/issue_fix/79_response_status_codes_are_not_the_codes_defined_in_spec/mysql"), [
'recursive' => true,
]);
$this->checkFiles($actualFiles, $expectedFiles);
}
}
Loading