setupFile = dirname( __FILE__ ) . '/../../PortableInfobox.setup.php'; $this->sanitizer = SanitizerBuilder::createFromType('title'); parent::setUp(); } /** * @param $data * @param $expected * @dataProvider testSanitizeDataProvider */ function testSanitize( $data, $expected ) { $this->assertEquals( $expected, $this->sanitizer->sanitize( $data ) ); } function testSanitizeDataProvider() { return [ [ ['value' => 'Test Title' ], [ 'value' => 'Test Title' ] ], [ ['value' => ' Test Title '], ['value' => 'Test Title'] ], [ ['value' => 'Test Title ' ], ['value' => 'Test Title'] ], [ ['value' => 'Test Title with link'], [ 'value' => 'Test Title with link'] ], [ ['value' => 'Real world DBGT Logotitle example'] , [ 'value' => 'Real world title example'] ], ]; } }