File tree 2 files changed +15
-0
lines changed
2 files changed +15
-0
lines changed Original file line number Diff line number Diff line change @@ -153,6 +153,17 @@ public function it_gets_pages_with_non_latin_tags()
153
153
$ this ->assertCount (1 , Page::whereTag (['한글-태그 ' ])->get ());
154
154
}
155
155
156
+ /** @test */
157
+ public function it_creates_page_without_tags ()
158
+ {
159
+ $ this ->createPage (['original tag ' ]);
160
+
161
+ $ page = $ this ->page ->find (1 );
162
+ $ page ->setTags (null );
163
+
164
+ $ this ->assertEmpty (Page::first ()->tags ->count ());
165
+ }
166
+
156
167
private function createPage (array $ tags = [])
157
168
{
158
169
return $ this ->page ->create ([
Original file line number Diff line number Diff line change @@ -97,6 +97,10 @@ public static function allTags()
97
97
*/
98
98
public function setTags ($ tags , $ type = 'slug ' )
99
99
{
100
+ if (empty ($ tags )) {
101
+ $ tags = [];
102
+ }
103
+
100
104
// Get the current entity tags
101
105
$ entityTags = $ this ->tags ->pluck ($ type )->all ();
102
106
You can’t perform that action at this time.
0 commit comments