Advertisement
Guest User

Test code

a guest
Sep 1st, 2015
68
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
PHP 1.02 KB | None | 0 0
  1. $schemas = [
  2.             new \MssqlSchema(App()->db),
  3.             new \PgsqlSchema(App()->db),
  4.             new \MysqlSchema(App()->db),
  5.         ];
  6.         $tests = [
  7.             'string(11)',
  8.             'string (11)',
  9.             'string',
  10.             'integer(4)',
  11.             'integer (4)',
  12.             'integer',
  13.             'decimal(10,40)',
  14.             'decimal (10,40)',
  15.             'decimal',
  16.             'float(10,40)'
  17.         ];
  18.         echo \CHtml::openTag('table');
  19.         echo "<tr>";
  20.         echo \CHtml::tag('th', [], '&nbsp;');
  21.         foreach($schemas as $schema) {
  22.             echo \CHtml::tag('th', [], get_class($schema));
  23.         }
  24.         echo "</tr>";
  25.         foreach($tests as $test) {
  26.             echo "<tr>";
  27.             echo \CHtml::tag('th', [], $test);
  28.             foreach($schemas as $schema) {
  29.                 echo \CHtml::tag('td', [], $schema->getColumnType($test));
  30.             }
  31.             echo "</tr>";
  32.  
  33.         }
  34.         echo \CHtml::closeTag('table');
  35.         die();
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement