ILIAS  release_4-4 Revision
Utf8Test.php File Reference

Go to the source code of this file.

Functions

 testLine ( $test, $line, &$total, &$success, &$failed)
 

Variables

if(php_sapi_name() !='cli') $in = fopen( "UTF-8-test.txt", "rt" )
 
if(! $in) $columns = 0
 
while(false !==( $line=fgets( $in))) if(! $columns) $ignore
 
 $exceptions
 
 $longTests
 
 $sectionTests = array( '3.4' )
 
 $section = NULL
 
 $test = ''
 
 $failed = 0
 
 $success = 0
 
 $total = 0
 
while(false !==( $line=fgets( $in))) if ($failed)
 

Function Documentation

◆ testLine()

testLine (   $test,
  $line,
$total,
$success,
$failed 
)

Definition at line 123 of file Utf8Test.php.

References $columns, $exceptions, $failed, $ok, $success, $test, $total, and $verbose.

123  {
124  $stripped = $line;
125  UtfNormal::quickisNFCVerify( $stripped );
126 
127  $same = ( $line == $stripped );
128  $len = mb_strlen( substr( $stripped, 0, strpos( $stripped, '|' ) ) );
129  if( $len == 0 ) {
130  $len = strlen( substr( $stripped, 0, strpos( $stripped, '|' ) ) );
131  }
132 
133  global $columns;
134  $ok = $same ^ ($test >= 3 );
135 
136  global $exceptions;
137  $ok ^= in_array( $test, $exceptions );
138 
139  $ok &= ($columns == $len);
140 
141  $total++;
142  if( $ok ) {
143  $success++;
144  } else {
145  $failed++;
146  }
147  global $verbose;
148  if( $verbose || !$ok ) {
149  print str_replace( "\n", "$len\n", $stripped );
150  }
151 }
$verbose
$total
Definition: Utf8Test.php:88
$success
Definition: Utf8Test.php:87
$failed
Definition: Utf8Test.php:86
if(! $in) $columns
Definition: Utf8Test.php:46
$exceptions
Definition: Utf8Test.php:68
$test
Definition: Utf8Test.php:85

Variable Documentation

◆ $columns

◆ $exceptions

$exceptions
Initial value:
= array(
# Tests that should mark invalid characters due to using long
# sequences beyond what is now considered legal.
'2.1.5', '2.1.6', '2.2.4', '2.2.5', '2.2.6', '2.3.5',
# Literal 0xffff, which is illegal
'2.2.3' )

Definition at line 68 of file Utf8Test.php.

Referenced by testLine().

◆ $failed

◆ $ignore

while (false !==($line=fgets($in))) if (! $columns) $ignore
Initial value:
= array(
# These two lines actually seem to be corrupt
'2.1.1', '2.2.1' )

Definition at line 64 of file Utf8Test.php.

Referenced by MDB2_Driver_Common\_skipDelimitedStrings().

◆ $in

if (php_sapi_name() !='cli') $in = fopen( "UTF-8-test.txt", "rt" )

Definition at line 38 of file Utf8Test.php.

◆ $longTests

$longTests
Initial value:
= array(
# These tests span multiple lines
'3.1.9', '3.2.1', '3.2.2', '3.2.3', '3.2.4', '3.2.5',
'3.4' )

Definition at line 76 of file Utf8Test.php.

◆ $section

◆ $sectionTests

$sectionTests = array( '3.4' )

Definition at line 82 of file Utf8Test.php.

◆ $success

◆ $test

$test = ''

Definition at line 85 of file Utf8Test.php.

Referenced by ilTestSubmissionReviewGUI\__construct(), ilCourseObjectiveQuestion\_getTest(), ilObjTest\_isComplete(), ilvCard\buildVCard(), ilCourseObjectiveQuestion\cloneDependencies(), ilContObjParser\copyFileItems(), ilObjAssessmentFolderGUI\exportLogObject(), ilFormat\fGeld(), ilCourseObjectivesTableGUI\fillRow(), ilFormat\fProzent(), Magic\get_language(), assClozeTestGUI\getAnswerFeedbackOutput(), ilCourseObjectiveQuestion\getFinalTests(), ilTestVerificationTableGUI\getItems(), ilCourseObjectiveQuestion\getSelfAssessmentTests(), ilCourseObjectiveQuestion\getTests(), ilSCORM2004SeqTemplate\ilSCORM2004SeqTemplate(), ilCourseObjectivesGUI\initFormLimits(), ilCourseObjectivesTableGUI\parse(), ilObjTestVerificationGUI\save(), assQuestionGUI\save(), assQuestionGUI\saveEdit(), assQuestionGUI\saveReturn(), assFormulaQuestionGUI\saveReturnFQ(), MDB2\setOptions(), ilObjAssessmentFolderGUI\showLogObject(), Structures_BibTex\Structures_BibTex(), BibTexTest\test_checkEqualSignFalse(), BibTexTest\test_checkEqualSignTrue(), BibTexTest\test_parseEntry(), BibTexTest\test_validateValueWarningAtInBraces(), BibTexTest\test_validateValueWarningEscapedDoubleQuoteInsideDoubleQuotes(), BibTexTest\test_validateValueWarningUnbalancedAmountOfBracesClosed(), BibTexTest\test_validateValueWarningUnbalancedAmountOfBracesOpen(), BibTexTest\testAllowedTypeFalse(), BibTexTest\testAllowedTypeTrue(), BibTexTest\testAllowedTypeWarning(), BibTexTest\testAuthorFirstDigitsArecaselessLowercase(), BibTexTest\testAuthorFirstDigitsArecaselessUppercase(), BibTexTest\testAuthorFirstGroupingCaselessOne(), BibTexTest\testAuthorFirstGroupingCaselessThree(), BibTexTest\testAuthorFirstGroupingCaselessTwo(), BibTexTest\testAuthorFirstLastCannotBeEmpty(), BibTexTest\testAuthorFirstLastCannotBeEmptyLowerCase(), BibTexTest\testAuthorFirstNonLettersAreCaselessLowerCase(), BibTexTest\testAuthorFirstNonLettersAreCaselessUpperCase(), BibTexTest\testAuthorFirstPseudoLettersAreCaselessLowerInsideLowerOutside(), BibTexTest\testAuthorFirstPseudoLettersAreCaselessLowerInsideUpperOutside(), BibTexTest\testAuthorFirstPseudoLettersAreCaselessUpperInsideLowerOutside(), BibTexTest\testAuthorFirstPseudoLettersAreCaselessUpperInsideUpperOutside(), BibTexTest\testAuthorFirstSimple(), BibTexTest\testAuthorFirstSimpleLowerCase(), BibTexTest\testAuthorFirstSimpleVon(), BibTexTest\testAuthorFirstSimpleVonInnerUppercase(), BibTexTest\testAuthorSecondAndThirdFirstCanBeEmptyAfterComma(), BibTexTest\testAuthorSecondAndThirdJrCanBeEmptyBetweenCommas(), BibTexTest\testAuthorSecondAndThirdLastPartCoannotBeEmpty(), BibTexTest\testAuthorSecondAndThirdSimpleCaseFirstLowercase(), BibTexTest\testAuthorSecondAndThirdSimpleCaseFirstUppercase(), BibTexTest\testAuthorSecondAndThirdSimpleJrLowercase(), BibTexTest\testAuthorSecondAndThirdSimpleJrUppercase(), BibTexTest\testAuthorSecondAndThirdSimpleVon(), BibTexTest\testCaseCaselessSimple(), BibTexTest\testCaseErrorEmptyString(), BibTexTest\testCaseErrorNonString(), BibTexTest\testCaseLowerComplexBrace(), BibTexTest\testCaseLowerComplexNumber(), BibTexTest\testCaseLowerComplexWhitespace(), BibTexTest\testCaseLowerSimple(), BibTexTest\testCaseUpperComplexBrace(), BibTexTest\testCaseUpperComplexNumber(), BibTexTest\testCaseUpperComplexWhitespace(), BibTexTest\testCaseUpperSimple(), BibTexTest\testExtractAuthors(), BibTexTest\testExtractAuthorTilde(), BibTexTest\testExtractAuthorWhitespace(), BibTexTest\testFormatAuthor(), BibTexTest\testHtmlExport(), testLine(), BibTexTest\testMissingLastBraceParsing(), BibTexTest\testMissingLastBraceParsing2(), BibTexTest\testMissingLastBraceWarning(), BibTexTest\testNewlineInAuthorField(), BibTexTest\testNotExtractAuthors(), BibTexTest\testNotExtractAuthorsBibtexExport(), BibTexTest\testNotExtractAuthorsHtmlExport(), BibTexTest\testNotExtractAuthorsRtfExport(), BibTexTest\testNotRemoveCurlyBraces(), BibTexTest\testRemoveCurlyBraces(), BibTexTest\testRemoveCurlyBraces2(), BibTexTest\testRemoveCurlyBracesWithoutBraces(), BibTexTest\testRtfExport(), ilCourseObjectivesGUI\updateFinalTestLimits(), ilCourseObjectivesGUI\updateSelfAssessmentLimits(), and ilTestArchiver\updateTestArchive().

◆ $total

$total = 0

Definition at line 88 of file Utf8Test.php.

Referenced by testLine().

◆ if

while (false !==($line=fgets($in))) if( $failed)

Definition at line 113 of file Utf8Test.php.