public function testFilters()
 {
     $this->emitter->filter('the_content', function ($content, $append) {
         return $content . ' ' . $append;
     });
     $this->emitter->filter('the_content', function ($content) {
         return $content . ' yolo';
     });
     $content = $this->emitter->applyFilters('the_content', 'ham', 'sandwich');
     $this->assertEquals('ham sandwich yolo', $content);
 }
Ejemplo n.º 2
0
 /**
  * @runInSeparateProcess
  */
 public function testCorrectArgsPassedToWordpressFunctionWhenPresent()
 {
     eval('function apply_filters() { return func_get_args(); }');
     $filtered = $this->emitter->applyFilters('foo', 'bar');
     $this->assertSame(array('foo', 'bar'), $filtered);
 }