MediaWiki  1.23.15
UtfNormalTest.php File Reference

Implements the conformance test at: http://www.unicode.org/Public/UNIDATA/NormalizationTest.txt. More...

Go to the source code of this file.

Functions

 reportResults (&$total, &$success, &$failure)
 
 testCleanUp (&$u, $c, $comment, $verbose)
 
 testInvariant (&$u, $char, $desc, $verbose, $reportFailure=false)
 
 testNFC (&$u, $c, $comment, $verbose)
 
 testNFD (&$u, $c, $comment, $verbose)
 
 testNFKC (&$u, $c, $comment, $verbose)
 
 testNFKD (&$u, $c, $comment, $verbose)
 
 testNormals (&$u, $c, $comment, $verbose, $reportFailure=false)
 
 verbosify ( $a, $b, $col, $form, $verbose)
 

Variables

 $failure = 0
 
 $in = fopen("NormalizationTest.txt", "rt")
 
if(! $in$normalizer = new UtfNormal
 
 $ok = true
 
 $success = 0
 
 $testedChars = array()
 
 $total = 0
 
if(PHP_SAPI !='cli') $verbose = true
 
if(defined( 'PRETTY_UTF8')) else
 
if(! $in) print Now testing invariants n
 

Detailed Description

Implements the conformance test at: http://www.unicode.org/Public/UNIDATA/NormalizationTest.txt.

Copyright © 2004 Brion Vibber brion.nosp@m.@pob.nosp@m.ox.co.nosp@m.m https://www.mediawiki.org/

This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version.

This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details.

You should have received a copy of the GNU General Public License along with this program; if not, write to the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. http://www.gnu.org/copyleft/gpl.html

Definition in file UtfNormalTest.php.

Function Documentation

◆ reportResults()

reportResults ( $total,
$success,
$failure 
)

Definition at line 144 of file UtfNormalTest.php.

References $failure, $ok, $success, and $total.

◆ testCleanUp()

testCleanUp ( $u,
  $c,
  $comment,
  $verbose 
)

Definition at line 193 of file UtfNormalTest.php.

References $verbose, and verbosify().

Referenced by testNormals().

◆ testInvariant()

testInvariant ( $u,
  $char,
  $desc,
  $verbose,
  $reportFailure = false 
)

Definition at line 234 of file UtfNormalTest.php.

References $verbose, and verbosify().

◆ testNFC()

testNFC ( $u,
  $c,
  $comment,
  $verbose 
)

Definition at line 184 of file UtfNormalTest.php.

References $verbose, and verbosify().

Referenced by testNormals().

◆ testNFD()

testNFD ( $u,
  $c,
  $comment,
  $verbose 
)

Definition at line 207 of file UtfNormalTest.php.

References $verbose, and verbosify().

Referenced by testNormals().

◆ testNFKC()

testNFKC ( $u,
  $c,
  $comment,
  $verbose 
)

Definition at line 216 of file UtfNormalTest.php.

References $verbose, and verbosify().

Referenced by testNormals().

◆ testNFKD()

testNFKD ( $u,
  $c,
  $comment,
  $verbose 
)

Definition at line 225 of file UtfNormalTest.php.

References $verbose, and verbosify().

Referenced by testNormals().

◆ testNormals()

testNormals ( $u,
  $c,
  $comment,
  $verbose,
  $reportFailure = false 
)

Definition at line 157 of file UtfNormalTest.php.

References $comment, $verbose, testCleanUp(), testNFC(), testNFD(), testNFKC(), and testNFKD().

◆ verbosify()

verbosify (   $a,
  $b,
  $col,
  $form,
  $verbose 
)

Definition at line 171 of file UtfNormalTest.php.

References $ok, and $verbose.

Referenced by testCleanUp(), testInvariant(), testNFC(), testNFD(), testNFKC(), and testNFKD().

Variable Documentation

◆ $failure

$failure = 0

Definition at line 70 of file UtfNormalTest.php.

Referenced by reportResults().

◆ $in

$in = fopen("NormalizationTest.txt", "rt")

Definition at line 58 of file UtfNormalTest.php.

◆ $normalizer

if (! $in) $normalizer = new UtfNormal

Definition at line 66 of file UtfNormalTest.php.

◆ $ok

$ok = true

Definition at line 71 of file UtfNormalTest.php.

Referenced by MappedIterator\accept(), JobQueue\ack(), JobQueue\batchPush(), ContentHandler\canBeUsedOn(), NamespaceConflictChecker\checkAll(), NamespaceConflictChecker\checkNamespace(), User\checkNewtalk(), FSFileBackend\chmod(), SiteSQLStore\clear(), SqliteInstaller\dataDirOKmaybeCreate(), JobQueue\deduplicateRootJob(), FileBackendStore\doConcatenate(), FSFileBackend\doCopyInternal(), WikiPage\doDeleteArticleReal(), FSFileBackend\doDeleteInternal(), WikiPage\doEditContent(), MemcLockManager\doFreeLocksOnServer(), FSFileBackend\doGetLocalCopyMulti(), MemcLockManager\doGetLocksOnServer(), PostgreSqlLockManager\doGetLocksOnServer(), FSFileBackend\doMoveInternal(), FSFileBackend\doStoreInternal(), FileBackendTest\doTestConcatenate(), UpdateRestrictions\execute(), ApiQueryTags\execute(), DatabasePostgres\fetchObject(), DatabaseMysqlBase\freeResult(), ApiUpload\getChunkResult(), SquidPurgeClient\getSocket(), TextPassDumper\getTextSpawnedOnce(), FSFileBackend\isPathUsableInternal(), TextContentHandler\merge3(), JobQueueAggregator\notifyQueueEmpty(), JobQueueAggregator\notifyQueueNonEmpty(), XMPReader\parse(), ApiUpload\performUpload(), CapsCleanup\processRow(), TempFSFile\purge(), JobQueueGroup\push(), reportResults(), ContentHandler\runLegacyHooks(), RevDel_List\setVisibility(), StreamFile\stream(), StatusTest\testIsGood(), StatusTest\testIsOk(), testLine(), ContentHandlerTest\testRunLegacyHooks(), StatusTest\testSetResult(), HttpTest\testValidateCookieDomain(), GlobalTest\testWfMkdirParents(), JobQueueFederated\tryJobInsertions(), SpecialUndelete\undelete(), DatabaseBase\upsert(), and verbosify().

◆ $success

$success = 0

Definition at line 69 of file UtfNormalTest.php.

Referenced by reportResults().

◆ $testedChars

$testedChars = array()

Definition at line 72 of file UtfNormalTest.php.

◆ $total

$total = 0

Definition at line 68 of file UtfNormalTest.php.

Referenced by reportResults().

◆ $verbose

if (PHP_SAPI !='cli') $verbose = true

◆ else

if ($ok) else
Initial value:
{
function pretty( $string ) {
return strtoupper( utf8ToHexSequence( $string ) );
}
}
if( isset( $_SERVER['argv'] ) && in_array( '--icu', $_SERVER['argv'] ) ) {
dl( 'php_utfnormal.so' );
}
require_once 'UtfNormalDefines.php'

Definition at line 39 of file UtfNormalTest.php.

◆ n

if (! $in) print Now testing invariants n

Definition at line 103 of file UtfNormalTest.php.

utf8ToHexSequence
utf8ToHexSequence( $str)
Take a UTF-8 string and return a space-separated series of hex numbers representing Unicode code poin...
Definition: UtfNormalUtil.php:78