Skip to content

Commit

Permalink
Add failing test
Browse files Browse the repository at this point in the history
  • Loading branch information
SOHELAHMED7 committed Sep 28, 2024
1 parent 9ec5b1b commit 87b01da
Show file tree
Hide file tree
Showing 4 changed files with 55 additions and 1 deletion.
1 change: 0 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -568,4 +568,3 @@ Professional support, consulting as well as software development services are av
https://www.cebe.cc/en/contact

Development of this library is sponsored by [cebe.:cloud: "Your Professional Deployment Platform"](https://cebe.cloud).

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

return [
'openApiPath' => '@specs/issue_fix/60_description_of_a_property_in_spec_must_correspond_to_db_table_column_comment/index.yml',
'generateUrls' => false,
'generateModels' => true,
'excludeModels' => [
'Error',
],
'generateControllers' => false,
'generateMigrations' => true,
'generateModelFaker' => true, // `generateModels` must be `true` in order to use `generateModelFaker` as `true`
];

Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
openapi: 3.0.3

info:
title: 'Description of a property in spec must correspond to DB TABLE COLUMN COMMENT #60'
version: 1.0.0

components:
schemas:
Fruit:
type: object
properties:
id:
type: integer
name:
type: string
description: desc
# colour:
# type: string
description:
type: string

paths:
'/':
get:
responses:
'200':
description: OK
14 changes: 14 additions & 0 deletions tests/unit/IssueFixTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -360,4 +360,18 @@ public function test158BugGiiapiGeneratedRulesEnumWithTrim()
]);
$this->checkFiles($actualFiles, $expectedFiles);
}

// https://github.com/php-openapi/yii2-openapi/issues/60
public function test60DescriptionOfAPropertyInSpecMustCorrespondToDbTableColumnComment()
{
$testFile = Yii::getAlias("@specs/issue_fix/60_description_of_a_property_in_spec_must_correspond_to_db_table_column_comment/index.php");
$this->runGenerator($testFile);
// $actualFiles = FileHelper::findFiles(Yii::getAlias('@app'), [
// 'recursive' => true,
// ]);
// $expectedFiles = FileHelper::findFiles(Yii::getAlias("@specs/issue_fix/60_description_of_a_property_in_spec_must_correspond_to_db_table_column_comment/mysql"), [
// 'recursive' => true,
// ]);
// $this->checkFiles($actualFiles, $expectedFiles);
}
}

0 comments on commit 87b01da

Please sign in to comment.