@@ -227,6 +227,8 @@ public function testNestedFiltersAndDoingFilter()
227227 Filters \expectApplied ('first_level ' )->once ()->andReturnUsing (function ($ arg ) {
228228
229229 static ::assertTrue (current_filter () === 'first_level ' );
230+ static ::assertTrue (doing_filter (), 'doing_filter() without hook name doesn \'t work (in first level) ' );
231+ static ::assertTrue (doing_filter (null ), 'doing_filter() with null hook name doesn \'t work (in first level) ' );
230232 static ::assertTrue (doing_filter ('first_level ' ));
231233 static ::assertFalse (doing_filter ('second_level ' ));
232234
@@ -237,6 +239,7 @@ public function testNestedFiltersAndDoingFilter()
237239
238240 static ::assertSame ('How is Monkey? ' , $ arg );
239241 static ::assertTrue (current_filter () === 'second_level ' );
242+ static ::assertTrue (doing_filter (), 'doing_filter() without hook name doesn \'t work (in second level) ' );
240243 static ::assertTrue (doing_filter ('first_level ' ));
241244 static ::assertTrue (doing_filter ('second_level ' ));
242245
@@ -245,6 +248,8 @@ public function testNestedFiltersAndDoingFilter()
245248
246249
247250 static ::assertSame ('Monkey is great! ' , apply_filters ('first_level ' , 'How is Monkey? ' ));
251+ static ::assertFalse (doing_filter (), 'doing_filter() without hook name doesn \'t work (in outer code) ' );
252+ static ::assertFalse (doing_filter (null ), 'doing_filter() with null hook name doesn \'t work (in outer code) ' );
248253 static ::assertFalse (doing_filter ('first_level ' ));
249254 static ::assertFalse (doing_filter ('second_level ' ));
250255 }
0 commit comments