Class SimpleDumper

Description

Displays variables as text and does diffs.

Located in /libraries/pear/simpletest/dumper.php (line 18)


	
			
Method Summary
 SimpleDumper SimpleDumper ()
 string clipString (string $value, integer $size, integer $position)
 string describeDifference (mixed $first, mixed $second, [boolean $identical = false])
 string describeValue (mixed $value)
 string dump (mixed $variable)
 void getFormattedAssertionLine (array $stack, [string $format = '%d'])
 string getType (mixed $value)
 string _describeArrayDifference (array $first, mixed $second, boolean $identical)
 string _describeBooleanDifference (boolean $first, mixed $second, boolean $identical)
 string _describeFloatDifference (float $first, mixed $second, boolean $identical)
 string _describeIntegerDifference (integer $first, mixed $second, boolean $identical)
 string _describeNullDifference (null $first, mixed $second, boolean $identical)
 string _describeObjectDifference (object $first, mixed $second, boolean $identical)
 string _describeResourceDifference (resource $first, mixed $second, boolean $identical)
 string _describeStringDifference (string $first, mixed $second, boolean $identical)
 boolean _isTypeMatch (mixed $first, mixed $second)
 integer _stringDiffersAt (string $first, string $second)
Methods
Constructor SimpleDumper (line 23)

Do nothing constructor.

SimpleDumper SimpleDumper ()
clipString (line 122)

Clips a string to a maximum length.

  • return: Shortened version.
  • access: public
string clipString (string $value, integer $size, integer $position)
  • string $value: String to truncate.
  • integer $size: Minimum string size to show.
  • integer $position: Centre of string section.
describeDifference (line 88)

Creates a human readable description of the difference between two variables. Uses a dynamic call.

  • return: Description of difference.
  • access: public
string describeDifference (mixed $first, mixed $second, [boolean $identical = false])
  • mixed $first: First variable.
  • mixed $second: Value to compare with.
  • boolean $identical: If true then type anomolies count.
describeValue (line 32)

Renders a variable in a shorter form than print_r().

  • return: Human readable string form.
  • access: public
string describeValue (mixed $value)
  • mixed $value: Variable to render as a string.
dump (line 320)

Sends a formatted dump of a variable to a string.

  • return: Output from print_r().
  • static:
  • access: public
string dump (mixed $variable)
  • mixed $variable: Variable to display.
getFormattedAssertionLine (line 336)

Extracts the last assertion that was not within Simpletest itself.

  • static:
  • access: public
void getFormattedAssertionLine (array $stack, [string $format = '%d'])
  • array $stack: List of stack frames.
  • string $format: String formatting.
getType (line 57)

Gets the string representation of a type.

  • return: Type.
  • access: public
string getType (mixed $value)
  • mixed $value: Variable to check against.
_describeArrayDifference (line 224)

Creates a human readable description of the difference between two arrays.

  • return: Human readable description.
  • access: private
string _describeArrayDifference (array $first, mixed $second, boolean $identical)
  • array $first: First array.
  • mixed $second: Array to compare with.
  • boolean $identical: If true then type anomolies count.
_describeBooleanDifference (line 160)

Creates a human readable description of the difference between a boolean and another variable.

  • return: Human readable description.
  • access: private
string _describeBooleanDifference (boolean $first, mixed $second, boolean $identical)
  • boolean $first: First boolean.
  • mixed $second: Boolean to compare with.
  • boolean $identical: If true then type anomolies count.
_describeFloatDifference (line 209)

Creates a human readable description of the difference between two floating point numbers.

  • return: Human readable description.
  • access: private
string _describeFloatDifference (float $first, mixed $second, boolean $identical)
  • float $first: First float.
  • mixed $second: Float to compare with.
  • boolean $identical: If true then type anomolies count.
_describeIntegerDifference (line 193)

Creates a human readable description of the difference between an integer and another variable.

  • return: Human readable description.
  • access: private
string _describeIntegerDifference (integer $first, mixed $second, boolean $identical)
  • integer $first: First number.
  • mixed $second: Number to compare with.
  • boolean $identical: If true then type anomolies count.
_describeNullDifference (line 145)

Creates a human readable description of the difference between a null and another variable.

  • return: Human readable description.
  • access: private
string _describeNullDifference (null $first, mixed $second, boolean $identical)
  • null $first: First null.
  • mixed $second: Null to compare with.
  • boolean $identical: If true then type anomolies count.
_describeObjectDifference (line 274)

Creates a human readable description of the difference between two objects.

  • return: Human readable description.
  • access: private
string _describeObjectDifference (object $first, mixed $second, boolean $identical)
  • object $first: First object.
  • mixed $second: Object to compare with.
  • boolean $identical: If true then type anomolies count.
_describeResourceDifference (line 259)

Creates a human readable description of the difference between a resource and another variable.

  • return: Human readable description.
  • access: private
string _describeResourceDifference (resource $first, mixed $second, boolean $identical)
  • resource $first: First resource.
  • mixed $second: Resource to compare with.
  • boolean $identical: If true then type anomolies count.
_describeStringDifference (line 175)

Creates a human readable description of the difference between a string and another variable.

  • return: Human readable description.
  • access: private
string _describeStringDifference (string $first, mixed $second, boolean $identical)
  • string $first: First string.
  • mixed $second: String to compare with.
  • boolean $identical: If true then type anomolies count.
_isTypeMatch (line 110)

Tests to see if types match.

  • return: True if matches.
  • access: private
boolean _isTypeMatch (mixed $first, mixed $second)
  • mixed $first: First variable.
  • mixed $second: Value to compare with.
_stringDiffersAt (line 295)

Find the first character position that differs in two strings by binary chop.

  • return: Position of first differing character.
  • access: private
integer _stringDiffersAt (string $first, string $second)
  • string $first: First string.
  • string $second: String to compare with.

Documentation generated on Fri, 10 Dec 2004 18:25:17 +0000 by phpDocumentor 1.3.0RC3