setupFile = dirname( __FILE__ ) . '/../../PortableInfobox.setup.php'; $this->sanitizer = new NodeDataSanitizer(); parent::setUp(); } /** * @param $data * @param $expected * @dataProvider testSanitizeDataProvider */ function testSanitize( $data, $expected ) { $this->assertEquals( $expected, $this->sanitizer->sanitize( $data ) ); } function testSanitizeDataProvider() { return [ [ [ 'label' => 'Data Link', 'value' => 'Data Value' ], [ 'label' => 'Data Link', 'value' => 'Data Value' ] ], [ ['label' => 'Test data label with image'], ['label' => 'Test data label with image'] ], [ [ 'label' => 'Data
with

div

with class
and other tags', 'value' => 'Data Value' ], [ 'label' => 'Data with div with class and other tags', 'value' => 'Data Value' ] ], [ [ 'label' => '', 'value' => 'Data Value' ], [ 'label' => '', 'value' => 'Data Value' ] ], ]; } }