[ Index ]

PHP Cross Reference of Limb3

title

Body

[close]

/dbal/tests/cases/driver/ -> DriverTableInfoTestBase.class.php (source)

   1  <?php
   2  /*
   3   * Limb PHP Framework
   4   *
   5   * @link http://limb-project.com 
   6   * @copyright  Copyright &copy; 2004-2007 BIT(http://bit-creative.com)
   7   * @license    LGPL http://www.gnu.org/copyleft/lesser.html 
   8   */
   9  require_once(dirname(__FILE__) . '/DriverMetaTestBase.class.php');
  10  
  11  abstract class DriverTableInfoTestBase extends DriverMetaTestBase
  12  {
  13    var $table;
  14  
  15    function setUp()
  16    {
  17      $dbinfo = $this->connection->getDatabaseInfo();
  18      $this->table = $dbinfo->getTable('founding_fathers');
  19    }
  20  
  21    function tearDown()
  22    {
  23      unset($this->table);
  24      parent::tearDown();
  25    }
  26  
  27    function testGetDatabase()
  28    {
  29      $db = $this->table->getDatabase();
  30      $this->assertIsA($db, 'lmbDbInfo');
  31    }
  32  
  33    function testGetName()
  34    {
  35      $this->assertEqual($this->table->getName(), 'founding_fathers');
  36    }
  37  
  38    function testHasColumn()
  39    {
  40      $this->assertTrue($this->table->hasColumn('id'));
  41      $this->assertTrue($this->table->hasColumn('first'));
  42      $this->assertTrue($this->table->hasColumn('last'));
  43    }
  44  
  45    function testGetColumn()
  46    {
  47      $column = $this->table->getColumn('last');
  48      $this->assertIsA($column, 'lmbDbColumnInfo');
  49    }
  50  
  51    function testGetColumnList()
  52    {
  53      $this->assertEqual($this->table->getColumnList(),
  54            array('id' => 'id', 'first' => 'first', 'last' => 'last'));
  55    }
  56  }
  57  
  58  ?>


Generated: Tue Oct 7 05:02:03 2008 Cross-referenced by PHPXref 0.7