public function testFilter() { $body_component = new Title('Example Title', null, $this->settings, $this->styles, $this->layouts); add_filter('apple_news_title_json', function ($json) { $json['textStyle'] = 'fancy-title'; return $json; }); $this->assertEquals(array('role' => 'title', 'text' => 'Example Title', 'textStyle' => 'fancy-title', 'layout' => 'title-layout'), $body_component->to_array()); }