@@ -80,7 +80,6 @@ protected function destroyApplication()
8080 Yii::$ app = null ;
8181 }
8282
83-
8483 /**
8584 * @param array $config controller config.
8685 * @return Controller controller instance.
@@ -101,16 +100,16 @@ protected function setupTestDbData()
101100
102101 $ db ->createCommand ()->createTable ('Cms ' , [
103102 'id ' => 'pk ' ,
104- 'url ' => 'string ' ,
105- 'title ' => 'string ' ,
106- 'content ' => 'text ' ,
107- 'status ' => 'integer ' ,
108- 'commentAvailable ' => 'integer ' ,
109- 'metaTitle ' => 'text ' ,
103+ 'url ' => 'string not null ' ,
104+ 'title ' => 'string not null ' ,
105+ 'content ' => 'text not null ' ,
106+ 'status ' => 'smallint not null default 1 ' ,
107+ 'commentAvailable ' => 'smallint not null default 0 ' ,
108+ 'metaTitle ' => 'text not null ' ,
110109 'metaDescription ' => 'text ' ,
111110 'metaKeywords ' => 'text ' ,
112- 'createdAt ' => 'integer ' ,
113- 'updatedAt ' => 'integer ' ,
111+ 'createdAt ' => 'integer not null ' ,
112+ 'updatedAt ' => 'integer not null ' ,
114113 ])->execute ();
115114
116115 // Data :
@@ -119,22 +118,22 @@ protected function setupTestDbData()
119118 'url ' => 'about-us ' ,
120119 'title ' => 'about ' ,
121120 'content ' => 'test content ' ,
122- 'status ' => 1 ,
123- 'commentAvailable ' => 0 ,
124121 'metaTitle ' => 'test content ' ,
125122 'metaDescription ' => 'test content ' ,
126- 'metaKeywords ' => 'test content '
123+ 'metaKeywords ' => 'test content ' ,
124+ 'createdAt ' => time (),
125+ 'updatedAt ' => time (),
127126 ])->execute ();
128127
129128 $ db ->createCommand ()->insert ('Cms ' , [
130129 'url ' => 'some-url ' ,
131130 'title ' => 'some title ' ,
132131 'content ' => 'My site name is {siteName} ' ,
133- 'status ' => 1 ,
134- 'commentAvailable ' => 0 ,
135132 'metaTitle ' => 'test content ' ,
136133 'metaDescription ' => 'test content ' ,
137- 'metaKeywords ' => 'test content '
134+ 'metaKeywords ' => 'test content ' ,
135+ 'createdAt ' => time (),
136+ 'updatedAt ' => time (),
138137 ])->execute ();
139138 }
140139}
0 commit comments