Mercurial > hg > isophonics-drupal-site
diff vendor/pear/console_table/tests/multibyte.phpt @ 0:4c8ae668cc8c
Initial import (non-working)
author | Chris Cannam |
---|---|
date | Wed, 29 Nov 2017 16:09:58 +0000 |
parents | |
children |
line wrap: on
line diff
--- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/vendor/pear/console_table/tests/multibyte.phpt Wed Nov 29 16:09:58 2017 +0000 @@ -0,0 +1,35 @@ +--TEST-- +Multibyte strings +--FILE-- +<?php + +if (file_exists(dirname(__FILE__) . '/../Table.php')) { + require_once dirname(__FILE__) . '/../Table.php'; +} else { + require_once 'Console/Table.php'; +} + +$table = new Console_Table(); +$table->setHeaders(array('Schön', 'Häßlich')); +$table->addData(array(array('Ich', 'Du'), array('Ä', 'Ü'))); +echo $table->getTable(); + +$table = new Console_Table(); +$table->addRow(array("I'm from 中国")); +$table->addRow(array("我是中国人")); +$table->addRow(array("I'm from China")); +echo $table->getTable(); + +?> +--EXPECT-- ++-------+---------+ +| Schön | Häßlich | ++-------+---------+ +| Ich | Du | +| Ä | Ü | ++-------+---------+ ++----------------+ +| I'm from 中国 | +| 我是中国人 | +| I'm from China | ++----------------+