File tree Expand file tree Collapse file tree 4 files changed +72
-0
lines changed Expand file tree Collapse file tree 4 files changed +72
-0
lines changed Original file line number Diff line number Diff line change 1+ <?php
2+
3+ namespace distinctm \LaravelDataSync \Tests ;
4+
5+ use Illuminate \Database \Eloquent \Model ;
6+
7+ class Roles extends Model
8+ {
9+
10+ }
Original file line number Diff line number Diff line change 1+ <?php
2+
3+ namespace distinctm \LaravelDataSync \Tests ;
4+
5+ class TestCase extends \Orchestra \Testbench \TestCase
6+ {
7+ protected function getEnvironmentSetUp ($ app )
8+ {
9+ $ app ['config ' ]->set ('database.default ' , 'testdb ' );
10+ $ app ['config ' ]->set ('database.connections.testdb ' , [
11+ 'driver ' => 'sqlite ' ,
12+ 'database ' => ':memory: '
13+ ]);
14+ }
15+ }
Original file line number Diff line number Diff line change 1+ <?php
2+
3+ namespace distinctm \LaravelDataSync \Tests ;
4+
5+ use distinctm \LaravelDataSync \Updater ;
6+
7+ class UpdaterTest extends TestCase
8+ {
9+ /** @test */
10+ public function exception_is_thrown_if_the_directory_does_not_exists ()
11+ {
12+ $ this ->expectException (\Exception::class);
13+
14+ new Updater ();
15+ }
16+
17+ /** @test */
18+ public function experiment ()
19+ {
20+ $ updater = new UpdaterFake (__DIR__ . '/../test-data ' , 'roles ' );
21+
22+ \DB ::enableQueryLog ();
23+ $ updater ->run ();
24+ \DB ::disableQueryLog ();
25+
26+ dd (\DB ::getQueryLog ());
27+ }
28+ }
29+
30+ class UpdaterFake extends Updater
31+ {
32+ protected function getModel (string $ name )
33+ {
34+ return Roles::class;
35+ }
36+ }
Original file line number Diff line number Diff line change 1+ [
2+ {
3+ "_slug" : " update-student-records"
4+ },
5+ {
6+ "_slug" : " borrow-ferrari"
7+ },
8+ {
9+ "_slug" : " destroy-ferrari"
10+ }
11+ ]
You can’t perform that action at this time.
0 commit comments