public static function PHPUnit_Util_Type::export

Exports a value into a string

The output of this method is similar to the output of print_r(), but improved in various aspects:

  • NULL is rendered as "null" (instead of "")
  • TRUE is rendered as "true" (instead of "1")
  • FALSE is rendered as "false" (instead of "")
  • Strings are always quoted with single quotes
  • Carriage returns and newlines are normalized to \n
  • Recursion and repeated rendering is treated properly

@since Method available since Release 3.6.0

Parameters

mixed $value The value to export:

integer $indentation The indentation level of the 2nd+ line:

Return value

string

19 calls to PHPUnit_Util_Type::export()
PHPUnit_Framework_Comparator_Array::assertEquals in drupal/core/vendor/phpunit/phpunit/PHPUnit/Framework/Comparator/Array.php
Asserts that two values are equal.
PHPUnit_Framework_Comparator_Numeric::assertEquals in drupal/core/vendor/phpunit/phpunit/PHPUnit/Framework/Comparator/Numeric.php
Asserts that two values are equal.
PHPUnit_Framework_Comparator_Object::assertEquals in drupal/core/vendor/phpunit/phpunit/PHPUnit/Framework/Comparator/Object.php
Asserts that two values are equal.
PHPUnit_Framework_Comparator_Resource::assertEquals in drupal/core/vendor/phpunit/phpunit/PHPUnit/Framework/Comparator/Resource.php
Asserts that two values are equal.
PHPUnit_Framework_Comparator_Scalar::assertEquals in drupal/core/vendor/phpunit/phpunit/PHPUnit/Framework/Comparator/Scalar.php
Asserts that two values are equal.

... See full list

File

drupal/core/vendor/phpunit/phpunit/PHPUnit/Util/Type.php, line 98

Class

PHPUnit_Util_Type
Utility class for textual type (and value) representation.

Code

public static function export($value, $indentation = 0) {
  return self::recursiveExport($value, $indentation);
}