Core
3.2
PHP API documentation
Main Page
Related Pages
Namespaces
Data Structures
Files
Examples
File List
Globals
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
20
class
TestHtmlclean
extends
TestCaseDcp
21
{
22
/**
23
* @dataProvider dataConvertHTMLFragmentToXHTMLDocument
24
*/
25
public
function
testConvertHTMLFragmentToXHTMLDocument
(
$data
)
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
36
public
function
dataConvertHTMLFragmentToXHTMLDocument
()
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
}
Dcp\Pu\TestHtmlclean\testConvertHTMLFragmentToXHTMLDocument
testConvertHTMLFragmentToXHTMLDocument($data)
Definition:
PU_test_dcp_htmlclean.php:25
Dcp\Pu\TestCaseDcp
Definition:
PU_testcase_dcp.php:17
Dcp\Pu\TestHtmlclean
Definition:
PU_test_dcp_htmlclean.php:20
Dcp\Pu\TestHtmlclean\dataConvertHTMLFragmentToXHTMLDocument
dataConvertHTMLFragmentToXHTMLDocument()
Definition:
PU_test_dcp_htmlclean.php:36
$data
$data
Definition:
fdl_sendmail.php:40
← centre documentaire
© anakeen