Core  3.2
PHP API documentation
 All Data Structures Namespaces Files Functions Variables Pages
PU_test_dcp_htmlclean.php
Go to the documentation of this file.
1 <?php
2 /*
3  * @author Anakeen
4  * @package FDL
5 */
6 
7 namespace Dcp\Pu;
8 /**
9  * @author Anakeen
10  * @package Dcp\Pu
11  */
12 
13 require_once 'PU_testcase_dcp.php';
14 
15 include_once 'FREEDOM/freedom_import_xml.php';
16 /**
17  * Test class for splitXmlDocument() function.
18  */
19 
21 {
22  /**
23  * @dataProvider dataConvertHTMLFragmentToXHTMLDocument
24  */
26  {
27  \Dcp\Utils\htmlclean::convertHTMLFragmentToXHTMLDocument($data['html'], $error);
28  if (!isset($data['errorMatch'])) {
29  /* We do not expect errors */
30  $this->assertEmpty($error, sprintf("Unexpected error '%s' when converting '%s'.", $error, $data['html']));
31  } else {
32  $this->assertTrue((preg_match($data['errorMatch'], $error) === 1) , sprintf("Error '%s' did not matched expected error match '%s'.", $error, $data['errorMatch']));
33  }
34  }
35 
37  {
38  return array(
39  array(
40  array(
41  'html' => '<a name="foo">foo#1</a><a name="foo">foo#2</a>',
42  // Expect no errors
43 
44  )
45  )
46  );
47  }
48 }
$data
← centre documentaire © anakeen