Drupal investigation

border-disable.phpt 1.4KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869
  1. --TEST--
  2. Border: disable it
  3. --FILE--
  4. <?php
  5. error_reporting(E_ALL | E_NOTICE);
  6. if (file_exists(dirname(__FILE__) . '/../Table.php')) {
  7. require_once dirname(__FILE__) . '/../Table.php';
  8. } else {
  9. require_once 'Console/Table.php';
  10. }
  11. $table = new Console_Table();
  12. $table->setHeaders(array('City', 'Mayor'));
  13. $table->addRow(array('Leipzig', 'Major Tom'));
  14. $table->addRow(array('New York', 'Towerhouse'));
  15. $table->setBorderVisibility(
  16. array(
  17. 'left' => false,
  18. 'right' => false,
  19. )
  20. );
  21. echo "Horizontal borders only:\n";
  22. echo $table->getTable() . "\n";
  23. $table->setBorderVisibility(
  24. array(
  25. 'top' => false,
  26. 'right' => false,
  27. 'bottom' => false,
  28. 'left' => false,
  29. 'inner' => false,
  30. )
  31. );
  32. echo "No borders:\n";
  33. echo $table->getTable() . "\n";
  34. $table->setBorderVisibility(
  35. array(
  36. 'top' => false,
  37. 'right' => true,
  38. 'bottom' => false,
  39. 'left' => true,
  40. 'inner' => true,
  41. )
  42. );
  43. echo "Vertical and inner only:\n";
  44. echo $table->getTable() . "\n";
  45. ?>
  46. --EXPECT--
  47. Horizontal borders only:
  48. ---------+-----------
  49. City | Mayor
  50. ---------+-----------
  51. Leipzig | Major Tom
  52. New York | Towerhouse
  53. ---------+-----------
  54. No borders:
  55. City | Mayor
  56. Leipzig | Major Tom
  57. New York | Towerhouse
  58. Vertical and inner only:
  59. | City | Mayor |
  60. +----------+------------+
  61. | Leipzig | Major Tom |
  62. | New York | Towerhouse |