File tree Expand file tree Collapse file tree 4 files changed +34
-6
lines changed Expand file tree Collapse file tree 4 files changed +34
-6
lines changed Original file line number Diff line number Diff line change 99 - COMPOSER_FLAGS="--prefer-lowest"
1010 - COMPOSER_FLAGS=""
1111
12+ before_install :
13+ - sudo apt-get update
14+ - sudo apt-get install -y graphviz
15+
1216before_script :
1317 - travis_retry composer self-update
1418 - travis_retry composer update ${COMPOSER_FLAGS} --no-interaction --prefer-source
Original file line number Diff line number Diff line change @@ -46,4 +46,16 @@ public function it_generated_graphviz_for_test_models_with_db_columns()
4646
4747 $ this ->assertMatchesSnapshot (Artisan::output ());
4848 }
49+
50+ /** @test */
51+ public function it_generated_graphviz_in_jpeg_format ()
52+ {
53+ $ this ->app ['config ' ]->set ('erd-generator.directories ' , [__DIR__ .'/Models ' ]);
54+
55+ Artisan::call ('generate:erd ' , [
56+ '--format ' => 'jpeg '
57+ ]);
58+
59+ $ this ->assertContains ('Wrote diagram to graph.jpeg ' , Artisan::output ());
60+ }
4961}
Original file line number Diff line number Diff line change 33namespace BeyondCode \ErdGenerator \Tests \Models ;
44
55use Illuminate \Database \Eloquent \Model ;
6+ use BeyondCode \ErdGenerator \Tests \Traits \HasComments ;
67
78class Post extends Model
89{
10+ use HasComments;
911
1012 public function user ()
1113 {
1214 return $ this ->belongsTo (User::class);
1315 }
1416
15- public function comments ()
16- {
17- return $ this ->hasMany (Comment::class);
18- }
19-
20- }
17+ }
Original file line number Diff line number Diff line change 1+ <?php
2+
3+ namespace BeyondCode \ErdGenerator \Tests \Traits ;
4+
5+ use BeyondCode \ErdGenerator \Tests \Models \Comment ;
6+
7+ trait HasComments
8+ {
9+
10+ public function comments ()
11+ {
12+ return $ this ->hasMany (Comment::class);
13+ }
14+
15+ }
You can’t perform that action at this time.
0 commit comments