File tree 2 files changed +25
-0
lines changed
specs/issue_fix/60_description_of_a_property_in_spec_must_correspond_to_db_table_column_comment 2 files changed +25
-0
lines changed Original file line number Diff line number Diff line change @@ -20,6 +20,14 @@ components:
20
20
type : string
21
21
x-db-type : varchar
22
22
description : desc 2
23
+ Animal :
24
+ type : object
25
+ properties :
26
+ id :
27
+ type : integer
28
+ name :
29
+ type : integer
30
+ description : desc
23
31
24
32
paths :
25
33
' / ' :
Original file line number Diff line number Diff line change @@ -364,6 +364,8 @@ public function test158BugGiiapiGeneratedRulesEnumWithTrim()
364
364
// https://github.com/php-openapi/yii2-openapi/issues/60
365
365
public function test60DescriptionOfAPropertyInSpecMustCorrespondToDbTableColumnComment ()
366
366
{
367
+ $ this ->deleteTableFor60DescriptionOfAPropertyInSpecMustCorrespondToDbTableColumnComment ();
368
+ $ this ->createTableFor60DescriptionOfAPropertyInSpecMustCorrespondToDbTableColumnComment ();
367
369
$ testFile = Yii::getAlias ("@specs/issue_fix/60_description_of_a_property_in_spec_must_correspond_to_db_table_column_comment/index.php " );
368
370
$ this ->runGenerator ($ testFile );
369
371
// $actualFiles = FileHelper::findFiles(Yii::getAlias('@app'), [
@@ -373,5 +375,20 @@ public function test60DescriptionOfAPropertyInSpecMustCorrespondToDbTableColumnC
373
375
// 'recursive' => true,
374
376
// ]);
375
377
// $this->checkFiles($actualFiles, $expectedFiles);
378
+
379
+ $ this ->deleteTableFor60DescriptionOfAPropertyInSpecMustCorrespondToDbTableColumnComment ();
380
+ }
381
+
382
+ private function createTableFor60DescriptionOfAPropertyInSpecMustCorrespondToDbTableColumnComment ()
383
+ {
384
+ Yii::$ app ->db ->createCommand ()->createTable ('{{%animals}} ' , [
385
+ 'id ' => 'pk ' ,
386
+ 'name ' => 'text comment "the name" ' ,
387
+ ])->execute ();
388
+ }
389
+
390
+ private function deleteTableFor60DescriptionOfAPropertyInSpecMustCorrespondToDbTableColumnComment ()
391
+ {
392
+ Yii::$ app ->db ->createCommand ('DROP TABLE IF EXISTS {{%animals}} ' )->execute ();
376
393
}
377
394
}
You can’t perform that action at this time.
0 commit comments