File tree Expand file tree Collapse file tree 3 files changed +16
-2
lines changed Expand file tree Collapse file tree 3 files changed +16
-2
lines changed Original file line number Diff line number Diff line change @@ -17,7 +17,7 @@ class Schemas extends \Tatter\Schemas\Config\Schemas
17
17
18
18
// Default handlers used to generate a schema
19
19
// (Probably shouldn't change this unless you really know what you're doing)
20
- public $ defaultHandlers = ['database ' , 'model ' ];
20
+ public $ defaultHandlers = ['database ' , 'model ' , ' file ' ];
21
21
22
22
// Whether to ignore the migrations table
23
23
public $ ignoreMigrationsTable = true ;
Original file line number Diff line number Diff line change @@ -9,7 +9,7 @@ class Schemas extends BaseConfig
9
9
10
10
// Default handlers used to generate a schema
11
11
// (Probably shouldn't change this unless you really know what you're doing)
12
- public $ defaultHandlers = ['database ' , 'model ' ];
12
+ public $ defaultHandlers = ['database ' , 'model ' , ' file ' ];
13
13
14
14
// Whether to ignore the migrations table
15
15
public $ ignoreMigrationsTable = true ;
Original file line number Diff line number Diff line change 3
3
use Tatter \Schemas \Handlers \CacheHandler ;
4
4
use Tatter \Schemas \Handlers \DatabaseHandler ;
5
5
use Tatter \Schemas \Handlers \FileHandler ;
6
+ use Tatter \Schemas \Handlers \ModelHandler ;
6
7
7
8
class LiveTest extends CIModuleTests \Support \DatabaseTestCase
8
9
{
@@ -33,4 +34,17 @@ public function testDatabaseMergeFile()
33
34
$ this ->assertObjectHasAttribute ('products ' , $ schema ->tables );
34
35
$ this ->assertCount (2 , $ schema ->tables ->workers ->relations );
35
36
}
37
+
38
+ public function testMergeAllHandlers ()
39
+ {
40
+ $ databaseHandler = new DatabaseHandler ($ this ->config , 'tests ' );
41
+ $ modelHandler = new ModelHandler ($ this ->config );
42
+ $ fileHandler = new FileHandler ($ this ->config );
43
+
44
+ $ schema = $ this ->schemas ->import ([$ databaseHandler , $ modelHandler , $ fileHandler ])->get ();
45
+
46
+ $ this ->assertObjectHasAttribute ('products ' , $ schema ->tables );
47
+ $ this ->assertEquals ('CIModuleTests\Support\Models\FactoryModel ' , $ schema ->tables ->factories ->model );
48
+ $ this ->assertCount (2 , $ schema ->tables ->workers ->relations );
49
+ }
36
50
}
You can’t perform that action at this time.
0 commit comments