File tree Expand file tree Collapse 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 Expand file tree Collapse file tree 2 files changed +25
-0
lines changed Original file line number Diff line number Diff line change @@ -20,6 +20,14 @@ components:
2020 type : string
2121 x-db-type : varchar
2222 description : desc 2
23+ Animal :
24+ type : object
25+ properties :
26+ id :
27+ type : integer
28+ name :
29+ type : integer
30+ description : desc
2331
2432paths :
2533 ' / ' :
Original file line number Diff line number Diff line change @@ -364,6 +364,8 @@ public function test158BugGiiapiGeneratedRulesEnumWithTrim()
364364 // https://github.com/php-openapi/yii2-openapi/issues/60
365365 public function test60DescriptionOfAPropertyInSpecMustCorrespondToDbTableColumnComment ()
366366 {
367+ $ this ->deleteTableFor60DescriptionOfAPropertyInSpecMustCorrespondToDbTableColumnComment ();
368+ $ this ->createTableFor60DescriptionOfAPropertyInSpecMustCorrespondToDbTableColumnComment ();
367369 $ testFile = Yii::getAlias ("@specs/issue_fix/60_description_of_a_property_in_spec_must_correspond_to_db_table_column_comment/index.php " );
368370 $ this ->runGenerator ($ testFile );
369371 // $actualFiles = FileHelper::findFiles(Yii::getAlias('@app'), [
@@ -373,5 +375,20 @@ public function test60DescriptionOfAPropertyInSpecMustCorrespondToDbTableColumnC
373375 // 'recursive' => true,
374376 // ]);
375377 // $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 ();
376393 }
377394}
You can’t perform that action at this time.
0 commit comments