@@ -72,28 +72,38 @@ public function output_writes_views_for_render_statements()
72
72
->with ('stubs/view.stub ' )
73
73
->andReturn ($ template );
74
74
75
+ $ this ->files ->shouldReceive ('exists ' )
76
+ ->times (2 )
77
+ ->with ('resources/views/user ' )
78
+ ->andReturnTrue ();
75
79
$ this ->files ->expects ('exists ' )
76
- ->with ('resources/user/index.blade.php ' )
80
+ ->with ('resources/views/ user/index.blade.php ' )
77
81
->andReturnFalse ();
78
82
$ this ->files ->expects ('put ' )
79
- ->with ('resources/user/index.blade.php ' , str_replace ('DummyView ' , 'user.index ' , $ template ));
83
+ ->with ('resources/views/ user/index.blade.php ' , str_replace ('DummyView ' , 'user.index ' , $ template ));
80
84
81
85
$ this ->files ->expects ('exists ' )
82
- ->with ('resources/user/create.blade.php ' )
86
+ ->with ('resources/views/ user/create.blade.php ' )
83
87
->andReturnFalse ();
84
88
$ this ->files ->expects ('put ' )
85
- ->with ('resources/user/create.blade.php ' , str_replace ('DummyView ' , 'user.create ' , $ template ));
89
+ ->with ('resources/views/ user/create.blade.php ' , str_replace ('DummyView ' , 'user.create ' , $ template ));
86
90
87
91
$ this ->files ->expects ('exists ' )
88
- ->with ('resources/post/show.blade.php ' )
92
+ ->with ('resources/views/post ' )
93
+ ->andReturns (false , true );
94
+ $ this ->files ->expects ('exists ' )
95
+ ->with ('resources/views/post/show.blade.php ' )
96
+ ->andReturnFalse ();
97
+ $ this ->files ->expects ('makeDirectory ' )
98
+ ->with ('resources/views/post ' )
89
99
->andReturnFalse ();
90
100
$ this ->files ->expects ('put ' )
91
- ->with ('resources/post/show.blade.php ' , str_replace ('DummyView ' , 'post.show ' , $ template ));
101
+ ->with ('resources/views/ post/show.blade.php ' , str_replace ('DummyView ' , 'post.show ' , $ template ));
92
102
93
103
$ tokens = $ this ->blueprint ->parse ($ this ->fixture ('definitions/render-statements.bp ' ));
94
104
$ tree = $ this ->blueprint ->analyze ($ tokens );
95
105
96
- $ this ->assertEquals (['created ' => ['resources/user/index.blade.php ' , 'resources/user/create.blade.php ' , 'resources/post/show.blade.php ' ]], $ this ->subject ->output ($ tree ));
106
+ $ this ->assertEquals (['created ' => ['resources/views/ user/index.blade.php ' , 'resources/views/ user/create.blade.php ' , 'resources/views /post/show.blade.php ' ]], $ this ->subject ->output ($ tree ));
97
107
}
98
108
99
109
/**
@@ -106,13 +116,13 @@ public function it_only_outputs_new_views()
106
116
->andReturn (file_get_contents ('stubs/view.stub ' ));
107
117
108
118
$ this ->files ->expects ('exists ' )
109
- ->with ('resources/user/index.blade.php ' )
119
+ ->with ('resources/views/ user/index.blade.php ' )
110
120
->andReturnTrue ();
111
121
$ this ->files ->expects ('exists ' )
112
- ->with ('resources/user/create.blade.php ' )
122
+ ->with ('resources/views/ user/create.blade.php ' )
113
123
->andReturnTrue ();
114
124
$ this ->files ->expects ('exists ' )
115
- ->with ('resources/post/show.blade.php ' )
125
+ ->with ('resources/views/ post/show.blade.php ' )
116
126
->andReturnTrue ();
117
127
118
128
$ tokens = $ this ->blueprint ->parse ($ this ->fixture ('definitions/render-statements.bp ' ));
0 commit comments