From e3a86c7c1fd6e8eb5c4f4ead03d4aa472c7e7c0b Mon Sep 17 00:00:00 2001 From: Chad Horohoe Date: Wed, 3 Feb 2010 17:57:52 +0000 Subject: [PATCH] Last tests were ported in r61938 or are otherwise unused, deleting /t and unifying unit tests once and for all --- t/.htaccess | 1 - t/DatabaseMock.inc | 33 --- t/README | 52 ----- t/Search.inc | 160 -------------- t/Test.php | 496 ------------------------------------------- t/inc/Language.t | 58 ----- t/inc/Licenses.t | 27 --- t/inc/Revision.t | 81 ------- t/inc/Sanitizer.t | 64 ------ t/inc/Search.t | 14 -- t/inc/SearchUpdate.t | 62 ------ t/inc/Title.t | 32 --- t/inc/Xml.t | 56 ----- tests/phpunit.xml | 3 +- 14 files changed, 2 insertions(+), 1137 deletions(-) delete mode 100644 t/.htaccess delete mode 100644 t/DatabaseMock.inc delete mode 100644 t/README delete mode 100644 t/Search.inc delete mode 100644 t/Test.php delete mode 100644 t/inc/Language.t delete mode 100644 t/inc/Licenses.t delete mode 100644 t/inc/Revision.t delete mode 100644 t/inc/Sanitizer.t delete mode 100644 t/inc/Search.t delete mode 100644 t/inc/SearchUpdate.t delete mode 100644 t/inc/Title.t delete mode 100644 t/inc/Xml.t diff --git a/t/.htaccess b/t/.htaccess deleted file mode 100644 index 3a42882788..0000000000 --- a/t/.htaccess +++ /dev/null @@ -1 +0,0 @@ -Deny from all diff --git a/t/DatabaseMock.inc b/t/DatabaseMock.inc deleted file mode 100644 index 59d380f5b0..0000000000 --- a/t/DatabaseMock.inc +++ /dev/null @@ -1,33 +0,0 @@ -mConn = true; - $this->mOpened = true; - } - - function open( $server, $user, $password, $dbName ) { return true; } - function doQuery( $sql ) {} - function fetchObject( $res ) {} - function fetchRow( $res ) {} - function numRows( $res ) {} - function numFields( $res ) {} - function fieldName( $res, $n ) {} - function insertId() {} - function dataSeek( $res, $row ) {} - function lastErrno() { return 0; } - function lastError() { return ''; } - function affectedRows() {} - function fieldInfo( $table, $field ) {} - function strencode( $s ) {} - function getSoftwareLink() {} - function getServerVersion() {} -} \ No newline at end of file diff --git a/t/README b/t/README deleted file mode 100644 index b3b9f42083..0000000000 --- a/t/README +++ /dev/null @@ -1,52 +0,0 @@ -=head1 NAME - -F - MediaWiki test tree - -=head1 DESCRIPTION - -This is the MediaWiki test tree (well, one of them), tests in this -directory are self-contained programs that produce TAP output via the -F module (/trunk/phase3/t/Test.php) (see -http://search.cpan.org/~petdance/TAP-1.00/TAP.pm#THE_TAP_FORMAT for -information on the TAP format). - -=head1 Running the tests - -To run all tests, you can run - - make test - -Since the tests are self-contained PHP programs you can run them -(Xml.t here) as: - - php t/inc/Xml.t - -That'll give you the raw TAP output, but what you probably want is to -use a TAP formatter such as L: - - prove t/inc/Xml.t # add -v for the verbose version - -or to run all the tests: - - prove -r t - -=head1 TODO - -=over - -=item * - -Rewrite the rest of the F stuff to use L and move it -here - -=item * - -Make the parsertests use TAP? - -=item * - -Write unit tests for the entire codebase:) - -=back - -=cut diff --git a/t/Search.inc b/t/Search.inc deleted file mode 100644 index 5f784c67b5..0000000000 --- a/t/Search.inc +++ /dev/null @@ -1,160 +0,0 @@ -isOpen() ) { - if ( !( stristr( $db->getSoftwareLink(), 'MySQL') && version_compare( $db->getServerVersion(), '4.1', '<' ) ) ) { - # Database that supports CREATE TABLE ... LIKE - foreach ($tables as $tbl) { - $newTableName = $db->tableName( $tbl ); - $tableName = $oldPrefix . $tbl; - $db->query("CREATE TEMPORARY TABLE $newTableName (LIKE $tableName)"); - } - } else { - # Hack for MySQL versions < 4.1, which don't support - # "CREATE TABLE ... LIKE". Note that - # "CREATE TEMPORARY TABLE ... SELECT * FROM ... LIMIT 0" - # would not create the indexes we need.... - foreach ($tables as $tbl) { - $res = $db->query("SHOW CREATE TABLE $tbl"); - $row = $db->fetchRow($res); - $create = $row[1]; - $create_tmp = preg_replace('/CREATE TABLE `(.*?)`/', 'CREATE TEMPORARY TABLE `' - . $wgDBprefix . '\\1`', $create); - if ($create === $create_tmp) { - # Couldn't do replacement - wfDie( "could not create temporary table $tbl" ); - } - $db->query($create_tmp); - } - - } - return $db; - } else { - // Something amiss - return null; - } -} - -class SearchEngineTest { - var $db, $search; - - function __construct( SearchEngine $search ){ - $this->search = $search; - $this->db = $this->search->db; - } - - function insertSearchData() { - $this->db->safeQuery( <<db->tableName( 'page' ) ); - $this->db->safeQuery( <<db->tableName( 'revision' ) ); - $this->db->safeQuery( <<db->tableName( 'text' ) ); - $this->db->safeQuery( <<db->tableName( 'searchindex' ) ); - } - - function fetchIds( $results ) { - $matches = array(); - while( $row = $results->next() ) { - $matches[] = $row->getTitle()->getPrefixedText(); - } - $results->free(); - # Search is not guaranteed to return results in a certain order; - # sort them numerically so we will compare simply that we received - # the expected matches. - sort( $matches ); - return $matches; - } - - function run(){ - if( is_null( $this->db ) ){ - fail( "Can't find a database to test with." ); - return; - } - - $this->insertSearchData(); - plan( 4 ); - - $exp = array( 'Smithee' ); - $got = $this->fetchIds( $this->search->searchText( 'smithee' ) ); - is( $got, $exp, "Plain search" ); - - $exp = array( 'Alan Smithee', 'Smithee' ); - $got = $this->fetchIds( $this->search->searchTitle( 'smithee' ) ); - is( $got, $exp, "Title search" ); - - $this->search->setNamespaces( array( 0, 1, 4 ) ); - - $exp = array( 'Smithee', 'Talk:Main Page', ); - $got = $this->fetchIds( $this->search->searchText( 'smithee' ) ); - is( $got, $exp, "Power search" ); - - $exp = array( 'Alan Smithee', 'Smithee', 'Talk:Smithee', ); - $got = $this->fetchIds( $this->search->searchTitle( 'smithee' ) ); - is( $got, $exp, "Title power search" ); - } -} diff --git a/t/Test.php b/t/Test.php deleted file mode 100644 index 7904f3ba42..0000000000 --- a/t/Test.php +++ /dev/null @@ -1,496 +0,0 @@ - null, - - # How many tests we've run, if 'planned' is still null by the time we're - # done we report the total count at the end - 'run' => 0, - - # Are are we currently within todo_start()/todo_end() ? - 'todo' => array(), -); - -function plan($plan, $why = '') -{ - global $__Test; - - $__Test['planned'] = true; - - switch ($plan) - { - case 'no_plan': - $__Test['planned'] = false; - break; - case 'skip_all'; - printf("1..0%s\n", $why ? " # Skip $why" : ''); - exit; - default: - printf("1..%d\n", $plan); - break; - } -} - -function pass($desc = '') -{ - return _proclaim(true, $desc); -} - -function fail($desc = '') -{ - return _proclaim(false, $desc); -} - -function ok($cond, $desc = '') { - return _proclaim($cond, $desc); -} - -function is($got, $expected, $desc = '') { - $pass = $got == $expected; - return _proclaim($pass, $desc, /* todo */ false, $got, $expected); -} - -function isnt($got, $expected, $desc = '') { - $pass = $got != $expected; - return _proclaim($pass, $desc, /* todo */ false, $got, $expected, /* negated */ true); -} - -function like($got, $expected, $desc = '') { - $pass = preg_match($expected, $got); - return _proclaim($pass, $desc, /* todo */ false, $got, $expected); -} - -function unlike($got, $expected, $desc = '') { - $pass = !preg_match($expected, $got); - return _proclaim($pass, $desc, /* todo */ false, $got, $expected, /* negated */ true); -} - -function cmp_ok($got, $op, $expected, $desc = '') -{ - $pass = null; - - # See http://www.php.net/manual/en/language.operators.comparison.php - switch ($op) - { - case '==': - $pass = $got == $expected; - break; - case '===': - $pass = $got === $expected; - break; - case '!=': - case '<>': - $pass = $got != $expected; - break; - case '!==': - $pass = $got !== $expected; - break; - case '<': - $pass = $got < $expected; - break; - case '>': - $pass = $got > $expected; - break; - case '<=': - $pass = $got <= $expected; - break; - case '>=': - $pass = $got >= $expected; - break; - default: - if (function_exists($op)) { - $pass = $op($got, $expected); - } else { - die("No such operator or function $op\n"); - } - } - - return _proclaim($pass, $desc, /* todo */ false, $got, "$got $op $expected"); -} - -function diag($message) -{ - if (is_array($message)) - { - $message = implode("\n", $message); - } - - foreach (explode("\n", $message) as $line) - { - echo "# $line\n"; - } -} - -function include_ok($file, $desc = '') -{ - $pass = include $file; - return _proclaim($pass, $desc == '' ? "include $file" : $desc); -} - -function require_ok($file, $desc = '') -{ - $pass = require $file; - return _proclaim($pass, $desc == '' ? "require $file" : $desc); -} - -function is_deeply($got, $expected, $desc = '') -{ - $diff = _cmp_deeply($got, $expected); - $pass = is_null($diff); - - if (!$pass) { - $got = strlen($diff['gpath']) ? ($diff['gpath'] . ' = ' . $diff['got']) - : _repl($got); - $expected = strlen($diff['epath']) ? ($diff['epath'] . ' = ' . $diff['expected']) - : _repl($expected); - } - - _proclaim($pass, $desc, /* todo */ false, $got, $expected); -} - -function isa_ok($obj, $expected, $desc = '') -{ - $pass = is_a($obj, $expected); - _proclaim($pass, $desc, /* todo */ false, $name, $expected); -} - -function todo_start($why = '') -{ - global $__Test; - - $__Test['todo'][] = $why; -} - -function todo_end() -{ - global $__Test; - - if (count($__Test['todo']) == 0) { - die("todo_end() called without a matching todo_start() call"); - } else { - array_pop($__Test['todo']); - } -} - -# -# The code below consists of private utility functions for the above functions -# - -function _proclaim( - $cond, # bool - $desc = '', - $todo = false, - $got = null, - $expected = null, - $negate = false) { - - global $__Test; - - $__Test['run'] += 1; - - # We're in a TODO block via todo_start()/todo_end(). TODO via specific - # functions is currently unimplemented and will probably stay that way - if (count($__Test['todo'])) { - $todo = true; - } - - # Everything after the first # is special, so escape user-supplied messages - $desc = str_replace('#', '\\#', $desc); - $desc = str_replace("\n", '\\n', $desc); - - $ok = $cond ? "ok" : "not ok"; - $directive = ''; - - if ($todo) { - $todo_idx = count($__Test['todo']) - 1; - $directive .= ' # TODO ' . $__Test['todo'][$todo_idx]; - } - - printf("%s %d %s%s\n", $ok, $__Test['run'], $desc, $directive); - - # report a failure - if (!$cond) { - # Every public function in this file calls _proclaim so our culprit is - # the second item in the stack - $caller = debug_backtrace(); - $call = $caller['1']; - - diag( - sprintf(" Failed%stest '%s'\n in %s at line %d\n got: %s\n expected: %s", - $todo ? ' TODO ' : ' ', - $desc, - $call['file'], - $call['line'], - $got, - $expected - ) - ); - } - - return $cond; -} - -function _test_ends() -{ - global $__Test; - - if (count($__Test['todo']) != 0) { - $todos = join("', '", $__Test['todo']); - die("Missing todo_end() for '$todos'"); - } - - if (!$__Test['planned']) { - printf("1..%d\n", $__Test['run']); - } -} - -# -# All of the below is for is_deeply() -# - -function _repl($obj, $deep = true) { - if (is_string($obj)) { - return "'" . $obj . "'"; - } else if (is_numeric($obj)) { - return $obj; - } else if (is_null($obj)) { - return 'null'; - } else if (is_bool($obj)) { - return $obj ? 'true' : 'false'; - } else if (is_array($obj)) { - return _repl_array($obj, $deep); - }else { - return gettype($obj); - } -} - -function _diff($gpath, $got, $epath, $expected) { - return array( - 'gpath' => $gpath, - 'got' => $got, - 'epath' => $epath, - 'expected' => $expected - ); -} - -function _idx($obj, $path = '') { - return $path . '[' . _repl($obj) . ']'; -} - -function _cmp_deeply($got, $exp, $path = '') { - if (is_array($exp)) { - - if (!is_array($got)) { - return _diff($path, _repl($got), $path, _repl($exp)); - } - - $gk = array_keys($got); - $ek = array_keys($exp); - $mc = max(count($gk), count($ek)); - - for ($el = 0; $el < $mc; $el++) { - # One array shorter than the other? - if ($el >= count($ek)) { - return _diff(_idx($gk[$el], $path), _repl($got[$gk[$el]]), - 'missing', 'nothing'); - } else if ($el >= count($gk)) { - return _diff('missing', 'nothing', - _idx($ek[$el], $path), _repl($exp[$ek[$el]])); - } - - # Keys differ? - if ($gk[$el] != $ek[$el]) { - return _diff(_idx($gk[$el], $path), _repl($got[$gk[$el]]), - _idx($ek[$el], $path), _repl($exp[$ek[$el]])); - } - - # Recurse - $rc = _cmp_deeply($got[$gk[$el]], $exp[$ek[$el]], _idx($gk[$el], $path)); - if (!is_null($rc)) { - return $rc; - } - } - } - else { - # Default to serialize hack - if (serialize($got) != serialize($exp)) { - return _diff($path, _repl($got), $path, _repl($exp)); - } - } - - return null; -} - -function _plural($n, $singular, $plural = null) { - if (is_null($plural)) { - $plural = $singular . 's'; - } - return $n == 1 ? "$n $singular" : "$n $plural"; -} - -function _repl_array($obj, $deep) { - if ($deep) { - $slice = array_slice($obj, 0, 3); # Increase from 3 to show more - $repl = array(); - $next = 0; - foreach ($slice as $idx => $el) { - $elrep = _repl($el, false); - if (is_numeric($idx) && $next == $idx) { - // Numeric index - $next++; - } else { - // Out of sequence or non-numeric - $elrep = _repl($idx, false) . ' => ' . $elrep; - } - $repl[] = $elrep; - } - $more = count($obj) - count($slice); - if ($more > 0) { - $repl[] = '... ' . _plural($more, 'more element') . ' ...'; - } - return 'array(' . join(', ', $repl) . ')'; - } - else { - return 'array(' . count($obj) . ')'; - } -} - -/* - -=head1 NAME - -Test.php - TAP test framework for PHP with a L-like interface - -=head1 SYNOPSIS - - #!/usr/bin/env php - - -=head1 DESCRIPTION - -F is an implementation of Perl's L for PHP. Like -Test::More it produces language agnostic TAP output (see L) which -can then be gathered, formatted and summarized by a program that -understands TAP such as prove(1). - -=head1 HOWTO - -First place the F in the project root or somewhere else in -the include path where C and C will find it. - -Then make a place to put your tests in, it's customary to place TAP -tests in a directory named F under the root but they can be -anywhere you like. Make a test in this directory or one of its subdirs -and try running it with php(1): - - $ php t/pass.t - 1..1 - ok 1 This dummy test passed - -The TAP output consists of very simple output, of course reading -larger output is going to be harder which is where prove(1) comes -in. prove is a harness program that reads test output and produces -reports based on it: - - $ prove t/pass.t - t/pass....ok - All tests successful. - Files=1, Tests=1, 0 wallclock secs ( 0.03 cusr + 0.02 csys = 0.05 CPU) - -To run all the tests in the F directory recursively use C. This can be put in a F under a I target, for -example: - - test: Test.php - prove -r t - -For reference the example test file above looks like this, the shebang -on the first line is needed so that prove(1) and other test harness -programs know they're dealing with a PHP file. - - #!/usr/bin/env php - - -=head1 SEE ALSO - -L - The TAP protocol - -=head1 AUTHOR - -Evar ArnfjErE Bjarmason and Andy Armstrong - -=head1 LICENSING - -The author or authors of this code dedicate any and all copyright -interest in this code to the public domain. We make this dedication -for the benefit of the public at large and to the detriment of our -heirs and successors. We intend this dedication to be an overt act of -relinquishment in perpetuity of all present and future rights this -code under copyright law. - -=cut - -*/ diff --git a/t/inc/Language.t b/t/inc/Language.t deleted file mode 100644 index ab8dfa4111..0000000000 --- a/t/inc/Language.t +++ /dev/null @@ -1,58 +0,0 @@ -#!/usr/bin/env php -userAdjust( $date, '' ) ), - '==', - strval( $expected ), - "User adjust {$date} by {$offset} minutes should give {$expected}" - ); -} - -# Collection of parameters for Language_t_Offset. -# Format: date to be formatted, localTZoffset value, expected date -$userAdjust_tests = array( - array( '20061231235959', '0', '20061231235959' ), - array( '20061231235959', '5', '20070101000459' ), - array( '20061231235959', '15', '20070101001459' ), - array( '20061231235959', '60', '20070101005959' ), - array( '20061231235959', '90', '20070101012959' ), - array( '20061231235959', '120', '20070101015959' ), - array( '20061231235959', '540', '20070101085959' ), - array( '20061231235959', '-5', '20061231235459' ), - array( '20061231235959', '-30', '20061231232959' ), - array( '20061231235959', '-60', '20061231225959' ), -); - -plan( count($userAdjust_tests) ); -define( 'MEDIAWIKI', 1 ); - -# Don't use require_ok as these files need global variables - -require 'includes/Defines.php'; -require 'includes/ProfilerStub.php'; - -require 'LocalSettings.php'; -require 'includes/DefaultSettings.php'; - -require 'includes/Setup.php'; - -# Create a language object -$wgContLang = $en = Language::factory( 'en' ); - -global $wgUser; -$wgUser = new User(); - -# Launch tests for language::userAdjust -foreach( $userAdjust_tests as $data ) { - test_userAdjust( $en, $data[0], $data[1], $data[2] ); -} - -/* vim: set filetype=php: */ diff --git a/t/inc/Licenses.t b/t/inc/Licenses.t deleted file mode 100644 index b4e803194c..0000000000 --- a/t/inc/Licenses.t +++ /dev/null @@ -1,27 +0,0 @@ -#!/usr/bin/env php -html; - -/* vim: set filetype=php: */ diff --git a/t/inc/Revision.t b/t/inc/Revision.t deleted file mode 100644 index 5ee0b163ab..0000000000 --- a/t/inc/Revision.t +++ /dev/null @@ -1,81 +0,0 @@ -#!/usr/bin/env php -old_flags = ''; -$row->old_text = 'This is a bunch of revision text.'; -cmp_ok( Revision::getRevisionText( $row ), '==', - 'This is a bunch of revision text.', 'Get revision text' ); - -$row = new stdClass; -$row->old_flags = 'gzip'; -$row->old_text = gzdeflate( 'This is a bunch of revision text.' ); -cmp_ok( Revision::getRevisionText( $row ), '==', - 'This is a bunch of revision text.', 'Get revision text with gzip compression' ); - -$wgLegacyEncoding = 'iso-8859-1'; - -$row = new stdClass; -$row->old_flags = 'utf-8'; -$row->old_text = "Wiki est l'\xc3\xa9cole superieur !"; -cmp_ok( Revision::getRevisionText( $row ), '==', - "Wiki est l'\xc3\xa9cole superieur !", 'Get revision text utf-8 native' ); - -$row = new stdClass; -$row->old_flags = ''; -$row->old_text = "Wiki est l'\xe9cole superieur !"; -cmp_ok( Revision::getRevisionText( $row ), '==', - "Wiki est l'\xc3\xa9cole superieur !", 'Get revision text utf-8 legacy' ); - -$row = new stdClass; -$row->old_flags = 'gzip,utf-8'; -$row->old_text = gzdeflate( "Wiki est l'\xc3\xa9cole superieur !" ); -cmp_ok( Revision::getRevisionText( $row ), '==', - "Wiki est l'\xc3\xa9cole superieur !", 'Get revision text utf-8 native and gzip' ); - -$row = new stdClass; -$row->old_flags = 'gzip'; -$row->old_text = gzdeflate( "Wiki est l'\xe9cole superieur !" ); -cmp_ok( Revision::getRevisionText( $row ), '==', - "Wiki est l'\xc3\xa9cole superieur !", 'Get revision text utf-8 native and gzip' ); - -$row = new stdClass; -$row->old_text = "Wiki est l'\xc3\xa9cole superieur !"; -$row->old_flags = Revision::compressRevisionText( $row->old_text ); -like( $row->old_flags, '/utf-8/', "Flags should contain 'utf-8'" ); -unlike( $row->old_flags, '/gzip/', "Flags should not contain 'gzip'" ); -cmp_ok( $row->old_text, '==', - "Wiki est l'\xc3\xa9cole superieur !", "Direct check" ); -cmp_ok( Revision::getRevisionText( $row ), '==', - "Wiki est l'\xc3\xa9cole superieur !", "getRevisionText" ); - -$wgCompressRevisions = true; - -$row = new stdClass; -$row->old_text = "Wiki est l'\xc3\xa9cole superieur !"; -$row->old_flags = Revision::compressRevisionText( $row->old_text ); -like( $row->old_flags, '/utf-8/', "Flags should contain 'utf-8'" ); -like( $row->old_flags, '/gzip/', "Flags should contain 'gzip'" ); -cmp_ok( gzinflate( $row->old_text ), '==', - "Wiki est l'\xc3\xa9cole superieur !", "Direct check" ); -cmp_ok( Revision::getRevisionText( $row ), '==', - "Wiki est l'\xc3\xa9cole superieur !", "getRevisionText" ); diff --git a/t/inc/Sanitizer.t b/t/inc/Sanitizer.t deleted file mode 100644 index ae2c9a23d0..0000000000 --- a/t/inc/Sanitizer.t +++ /dev/null @@ -1,64 +0,0 @@ -#!/usr/bin/env php -Hello world' ), - '==', - '
Hello world
', - 'Self-closing closing div' -); - -/* vim: set filetype=php: */ diff --git a/t/inc/Search.t b/t/inc/Search.t deleted file mode 100644 index 2f06dcd9fe..0000000000 --- a/t/inc/Search.t +++ /dev/null @@ -1,14 +0,0 @@ -#!/usr/bin/env php -run(); - -/* vim: set filetype=php: */ diff --git a/t/inc/SearchUpdate.t b/t/inc/SearchUpdate.t deleted file mode 100644 index f4ae3f7a36..0000000000 --- a/t/inc/SearchUpdate.t +++ /dev/null @@ -1,62 +0,0 @@ -#!/usr/bin/env php -doUpdate(); - return array( MockSearch::$title, MockSearch::$text ); -} - -function updateText( $text ) { - list( $title, $resultText ) = update( $text ); - $resultText = trim( $resultText ); // abstract from some implementation details - return $resultText; -} - -is( updateText( '
TeSt
' ), 'test', 'HTML stripped, text lowercased' ); - -is( updateText( << -
foo
bar - bozquux - -EOT -), 'foo bar boz quux', 'Stripping HTML tables' ); - -is( updateText( 'a > b' ), 'a b', 'Handle unclosed tags' ); - -$text = str_pad( "foo |", $chr ) !== false || preg_match( "/[\\x00-\\x1f\\x7f]/", $chr ) ) { - unlike( $chr, "/[$titlechars]/", "chr($num) = $chr is not a valid titlechar" ); - } else { - like( $chr, "/[$titlechars]/", "chr($num) = $chr is a valid titlechar" ); - } -} - -/* vim: set filetype=php: */ diff --git a/t/inc/Xml.t b/t/inc/Xml.t deleted file mode 100644 index b7cef881ad..0000000000 --- a/t/inc/Xml.t +++ /dev/null @@ -1,56 +0,0 @@ -#!/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' ); - -/* vim: set filetype=php: */ diff --git a/tests/phpunit.xml b/tests/phpunit.xml index 58e50e6ac8..4e54640418 100644 --- a/tests/phpunit.xml +++ b/tests/phpunit.xml @@ -1,7 +1,8 @@ + stopOnFailure="false" + verbose="true"> -- 2.20.1