drupal-civicrm/vendor/pear/console_table/tests/colors.phpt
2018-01-14 13:10:16 +00:00

29 lines
696 B
PHP
Raw Blame History

This file contains invisible Unicode characters

This file contains invisible Unicode characters that are indistinguishable to humans but may be processed differently by a computer. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

--TEST--
Data with ANSI color codes
--SKIPIF--
<?php if (!(@include 'Console/Color2.php')) echo 'skip Console_Color2 not installed'; ?>
--FILE--
<?php
if (file_exists(dirname(__FILE__) . '/../Table.php')) {
require_once dirname(__FILE__) . '/../Table.php';
} else {
require_once 'Console/Table.php';
}
require_once 'Console/Color2.php';
$cc = new Console_Color2();
$table = new Console_Table(CONSOLE_TABLE_ALIGN_LEFT, CONSOLE_TABLE_BORDER_ASCII, 1, null, true);
$table->setHeaders(array('foo', 'bar'));
$table->addRow(array('baz', $cc->convert("%bblue%n")));
echo $table->getTable();
?>
--EXPECT--
+-----+------+
| foo | bar |
+-----+------+
| baz | blue |
+-----+------+