@@ -89,8 +89,8 @@ public function testPaginationWorksOnBelongsToMany()
89
89
// Paginating relations will work before L5.4 but won't contain the pivot attribute
90
90
$ this ->markTestSkipped (
91
91
'Pagination is overwritten with a Relation macro to append the pivot to pivotable relations. '
92
- .' This was introduced in Laravel 5.4 when Relations implemented the Macroable trait. '
93
- .' https://github.com/illuminate/database/commit/4d13b0f80439bd17befb0fd646a117b818efdb14 '
92
+ .' This was introduced in Laravel 5.4 when Relations implemented the Macroable trait. '
93
+ .' https://github.com/illuminate/database/commit/4d13b0f80439bd17befb0fd646a117b818efdb14 '
94
94
);
95
95
}
96
96
}
@@ -114,8 +114,13 @@ protected function dbSetup()
114
114
$ this ->db = new DatabaseManager ($ container , new ConnectionFactory ($ container ));
115
115
Model::setConnectionResolver ($ this ->db );
116
116
$ connection = $ this ->db ->connection ('sqlite ' );
117
- $ connection ->setSchemaGrammar (new \Illuminate \Database \Schema \Grammars \SQLiteGrammar );
118
- $ connection ->setQueryGrammar (new \Illuminate \Database \Query \Grammars \SQLiteGrammar );
117
+ $ installedVersion = (int ) \Composer \InstalledVersions::getVersion ('illuminate/database ' );
118
+ $ connection ->setSchemaGrammar (
119
+ $ installedVersion >= 12 ? new \Illuminate \Database \Schema \Grammars \SQLiteGrammar ($ connection ) : new \Illuminate \Database \Schema \Grammars \SQLiteGrammar
120
+ );
121
+ $ connection ->setQueryGrammar (
122
+ $ installedVersion >= 12 ? new \Illuminate \Database \Query \Grammars \SQLiteGrammar ($ connection ) : new \Illuminate \Database \Query \Grammars \SQLiteGrammar
123
+ );
119
124
$ this ->schema = new SchemaBuilder ($ connection );
120
125
$ this ->schema ->create ('users ' , function (\Illuminate \Database \Schema \Blueprint $ table ) {
121
126
$ table ->increments ('id ' );
0 commit comments