Skip to content

Commit 87b01da

Browse files
committed
Add failing test
1 parent 9ec5b1b commit 87b01da

File tree

4 files changed

+55
-1
lines changed

4 files changed

+55
-1
lines changed

README.md

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -568,4 +568,3 @@ Professional support, consulting as well as software development services are av
568568
https://www.cebe.cc/en/contact
569569

570570
Development of this library is sponsored by [cebe.:cloud: "Your Professional Deployment Platform"](https://cebe.cloud).
571-
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
<?php
2+
3+
return [
4+
'openApiPath' => '@specs/issue_fix/60_description_of_a_property_in_spec_must_correspond_to_db_table_column_comment/index.yml',
5+
'generateUrls' => false,
6+
'generateModels' => true,
7+
'excludeModels' => [
8+
'Error',
9+
],
10+
'generateControllers' => false,
11+
'generateMigrations' => true,
12+
'generateModelFaker' => true, // `generateModels` must be `true` in order to use `generateModelFaker` as `true`
13+
];
14+
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,27 @@
1+
openapi: 3.0.3
2+
3+
info:
4+
title: 'Description of a property in spec must correspond to DB TABLE COLUMN COMMENT #60'
5+
version: 1.0.0
6+
7+
components:
8+
schemas:
9+
Fruit:
10+
type: object
11+
properties:
12+
id:
13+
type: integer
14+
name:
15+
type: string
16+
description: desc
17+
# colour:
18+
# type: string
19+
description:
20+
type: string
21+
22+
paths:
23+
'/':
24+
get:
25+
responses:
26+
'200':
27+
description: OK

tests/unit/IssueFixTest.php

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -360,4 +360,18 @@ public function test158BugGiiapiGeneratedRulesEnumWithTrim()
360360
]);
361361
$this->checkFiles($actualFiles, $expectedFiles);
362362
}
363+
364+
// https://github.com/php-openapi/yii2-openapi/issues/60
365+
public function test60DescriptionOfAPropertyInSpecMustCorrespondToDbTableColumnComment()
366+
{
367+
$testFile = Yii::getAlias("@specs/issue_fix/60_description_of_a_property_in_spec_must_correspond_to_db_table_column_comment/index.php");
368+
$this->runGenerator($testFile);
369+
// $actualFiles = FileHelper::findFiles(Yii::getAlias('@app'), [
370+
// 'recursive' => true,
371+
// ]);
372+
// $expectedFiles = FileHelper::findFiles(Yii::getAlias("@specs/issue_fix/60_description_of_a_property_in_spec_must_correspond_to_db_table_column_comment/mysql"), [
373+
// 'recursive' => true,
374+
// ]);
375+
// $this->checkFiles($actualFiles, $expectedFiles);
376+
}
363377
}

0 commit comments

Comments
 (0)