view vendor/pear/console_table/tests/border-custom2.phpt @ 9:1fc0ff908d1f

Add another data file
author Chris Cannam
date Mon, 05 Feb 2018 12:34:32 +0000
parents 4c8ae668cc8c
children
line wrap: on
line source
--TEST--
Border: new custom mode, alternative style
--FILE--
<?php
error_reporting(E_ALL | E_NOTICE);
if (file_exists(dirname(__FILE__) . '/../Table.php')) {
    require_once dirname(__FILE__) . '/../Table.php';
} else {
    require_once 'Console/Table.php';
}
$table = new Console_Table(
    CONSOLE_TABLE_ALIGN_LEFT,
    array('horizontal' => '=', 'vertical' => '', 'intersection' => '')
);
$table->setHeaders(array('City', 'Mayor'));
$table->addRow(array('Leipzig', 'Major Tom'));
$table->addRow(array('New York', 'Towerhouse'));

echo $table->getTable();
?>
--EXPECT--
======================
 City      Mayor      
======================
 Leipzig   Major Tom  
 New York  Towerhouse 
======================