From ace37bae5373bfdbb6a1be1d700883e27bd9f266 Mon Sep 17 00:00:00 2001 From: =?utf8?q?=C3=86var=20Arnfj=C3=B6r=C3=B0=20Bjarmason?= Date: Sun, 31 Dec 2006 09:18:54 +0000 Subject: [PATCH] * Test cases for some includes/ stuff --- t/00-test.t | 8 +++++++ t/README | 10 ++++++++ t/inc/IP.t | 60 +++++++++++++++++++++++++++++++++++++++++++++++ t/inc/Licenses.t | 29 +++++++++++++++++++++++ t/inc/Sanitizer.t | 55 +++++++++++++++++++++++++++++++++++++++++++ t/inc/Xml.t | 56 +++++++++++++++++++++++++++++++++++++++++++ 6 files changed, 218 insertions(+) create mode 100644 t/00-test.t create mode 100644 t/README create mode 100644 t/inc/IP.t create mode 100644 t/inc/Licenses.t create mode 100644 t/inc/Sanitizer.t create mode 100644 t/inc/Xml.t diff --git a/t/00-test.t b/t/00-test.t new file mode 100644 index 0000000000..c3defa404a --- /dev/null +++ b/t/00-test.t @@ -0,0 +1,8 @@ +#!/usr/bin/env php + diff --git a/t/README b/t/README new file mode 100644 index 0000000000..3141f2c658 --- /dev/null +++ b/t/README @@ -0,0 +1,10 @@ +=head1 NAME + +F - MediaWiki test tree + +=head1 DESCRIPTION + +This is the MediaWiki test tree (well, one of them), tests here +produce TAP output, see L. + +=cut diff --git a/t/inc/IP.t b/t/inc/IP.t new file mode 100644 index 0000000000..85fe8cb634 --- /dev/null +++ b/t/inc/IP.t @@ -0,0 +1,60 @@ +#!/usr/bin/env php + \ No newline at end of file diff --git a/t/inc/Licenses.t b/t/inc/Licenses.t new file mode 100644 index 0000000000..86202bd670 --- /dev/null +++ b/t/inc/Licenses.t @@ -0,0 +1,29 @@ +#!/usr/bin/env php +html; + + + + +?> \ No newline at end of file diff --git a/t/inc/Sanitizer.t b/t/inc/Sanitizer.t new file mode 100644 index 0000000000..812cebc9d8 --- /dev/null +++ b/t/inc/Sanitizer.t @@ -0,0 +1,55 @@ +#!/usr/bin/env php +', + 'Opening element with no attributes' +); + +cmp_ok( + Xml::element( 'element', null, '' ), + '==', + '', + 'Terminated empty element' +); + +cmp_ok( + Xml::element( 'element', null, 'hello you & you' ), + '==', + 'hello <there> you & you', + 'Element with no attributes and content that needs escaping' +); + +cmp_ok( + Xml::element( 'element', array( 'key' => 'value', '<>' => '<>' ), null ), + '==', + '="<>">', + 'Element attributes, keys are not escaped' +); + +# +# open/close element +# + +cmp_ok( + Xml::openElement( 'element', array( 'k' => 'v' ) ), + '==', + '', + 'openElement() shortcut' +); + +cmp_ok( Xml::closeElement( 'element' ), '==', '', 'closeElement() shortcut' ); + +?> \ No newline at end of file -- 2.20.1