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 9
9
- COMPOSER_FLAGS="--prefer-lowest"
10
10
- COMPOSER_FLAGS=""
11
11
12
+ before_install :
13
+ - sudo apt-get update
14
+ - sudo apt-get install -y graphviz
15
+
12
16
before_script :
13
17
- travis_retry composer self-update
14
18
- 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()
46
46
47
47
$ this ->assertMatchesSnapshot (Artisan::output ());
48
48
}
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
+ }
49
61
}
Original file line number Diff line number Diff line change 3
3
namespace BeyondCode \ErdGenerator \Tests \Models ;
4
4
5
5
use Illuminate \Database \Eloquent \Model ;
6
+ use BeyondCode \ErdGenerator \Tests \Traits \HasComments ;
6
7
7
8
class Post extends Model
8
9
{
10
+ use HasComments;
9
11
10
12
public function user ()
11
13
{
12
14
return $ this ->belongsTo (User::class);
13
15
}
14
16
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