@@ -56,12 +56,13 @@ public function test_can_make_configuration()
56
56
->once ()
57
57
->with ('migrations.default ' , [])
58
58
->andReturn ([
59
- 'name ' => 'Doctrine Migrations ' ,
60
- 'namespace ' => 'Database \\Migrations ' ,
61
- 'table ' => 'migrations ' ,
62
- 'schema ' => ['filter ' => '/^(?).*$/ ' ],
63
- 'directory ' => database_path ('migrations ' ),
64
- 'naming_strategy ' => DefaultNamingStrategy::class,
59
+ 'name ' => 'Doctrine Migrations ' ,
60
+ 'namespace ' => 'Database \\Migrations ' ,
61
+ 'table ' => 'migrations ' ,
62
+ 'schema ' => ['filter ' => '/^(?).*$/ ' ],
63
+ 'directory ' => database_path ('migrations ' ),
64
+ 'organize_migrations ' => Configuration::VERSIONS_ORGANIZATION_BY_YEAR_AND_MONTH ,
65
+ 'naming_strategy ' => DefaultNamingStrategy::class,
65
66
])
66
67
;
67
68
@@ -81,6 +82,8 @@ public function test_can_make_configuration()
81
82
$ this ->assertEquals ('migrations ' , $ configuration ->getMigrationsTableName ());
82
83
$ this ->assertInstanceOf (DefaultNamingStrategy::class, $ configuration ->getNamingStrategy ());
83
84
$ this ->assertEquals (database_path ('migrations ' ), $ configuration ->getMigrationsDirectory ());
85
+ $ this ->assertEquals (true , $ configuration ->areMigrationsOrganizedByYear ());
86
+ $ this ->assertEquals (true , $ configuration ->areMigrationsOrganizedByYearAndMonth ());
84
87
}
85
88
86
89
public function test_can_make_configuration_for_custom_entity_manager ()
@@ -96,12 +99,13 @@ public function test_can_make_configuration_for_custom_entity_manager()
96
99
->once ()
97
100
->with ('migrations.custom_entity_manager ' , [])
98
101
->andReturn ([
99
- 'name ' => 'Migrations ' ,
100
- 'namespace ' => 'Database \\Migrations \\Custom ' ,
101
- 'table ' => 'migrations ' ,
102
- 'schema ' => ['filter ' => '/^(?!^(custom)$).*$/ ' ],
103
- 'directory ' => database_path ('migrations/custom ' ),
104
- 'naming_strategy ' => DefaultNamingStrategy::class,
102
+ 'name ' => 'Migrations ' ,
103
+ 'namespace ' => 'Database \\Migrations \\Custom ' ,
104
+ 'table ' => 'migrations ' ,
105
+ 'schema ' => ['filter ' => '/^(?!^(custom)$).*$/ ' ],
106
+ 'directory ' => database_path ('migrations/custom ' ),
107
+ 'organize_migrations ' => Configuration::VERSIONS_ORGANIZATION_BY_YEAR_AND_MONTH ,
108
+ 'naming_strategy ' => DefaultNamingStrategy::class,
105
109
])
106
110
;
107
111
@@ -123,6 +127,8 @@ public function test_can_make_configuration_for_custom_entity_manager()
123
127
$ this ->assertEquals ('migrations ' , $ configuration ->getMigrationsTableName ());
124
128
$ this ->assertInstanceOf (DefaultNamingStrategy::class, $ configuration ->getNamingStrategy ());
125
129
$ this ->assertEquals (database_path ('migrations/custom ' ), $ configuration ->getMigrationsDirectory ());
130
+ $ this ->assertEquals (true , $ configuration ->areMigrationsOrganizedByYear ());
131
+ $ this ->assertEquals (true , $ configuration ->areMigrationsOrganizedByYearAndMonth ());
126
132
}
127
133
128
134
public function test_returns_default_configuration_if_not_defined ()
@@ -138,12 +144,13 @@ public function test_returns_default_configuration_if_not_defined()
138
144
->once ()
139
145
->with ('migrations.default ' , [])
140
146
->andReturn ([
141
- 'name ' => 'Doctrine Migrations ' ,
142
- 'namespace ' => 'Database \\Migrations ' ,
143
- 'table ' => 'migrations ' ,
144
- 'schema ' => ['filter ' => '/^(?).*$/ ' ],
145
- 'directory ' => database_path ('migrations ' ),
146
- 'naming_strategy ' => DefaultNamingStrategy::class,
147
+ 'name ' => 'Doctrine Migrations ' ,
148
+ 'namespace ' => 'Database \\Migrations ' ,
149
+ 'table ' => 'migrations ' ,
150
+ 'schema ' => ['filter ' => '/^(?).*$/ ' ],
151
+ 'directory ' => database_path ('migrations ' ),
152
+ 'organize_migrations ' => Configuration::VERSIONS_ORGANIZATION_BY_YEAR_AND_MONTH ,
153
+ 'naming_strategy ' => DefaultNamingStrategy::class,
147
154
])
148
155
;
149
156
@@ -162,6 +169,8 @@ public function test_returns_default_configuration_if_not_defined()
162
169
$ this ->assertEquals ('migrations ' , $ configuration ->getMigrationsTableName ());
163
170
$ this ->assertInstanceOf (DefaultNamingStrategy::class, $ configuration ->getNamingStrategy ());
164
171
$ this ->assertEquals (database_path ('migrations ' ), $ configuration ->getMigrationsDirectory ());
172
+ $ this ->assertEquals (true , $ configuration ->areMigrationsOrganizedByYear ());
173
+ $ this ->assertEquals (true , $ configuration ->areMigrationsOrganizedByYearAndMonth ());
165
174
}
166
175
167
176
protected function tearDown ()
0 commit comments