Example #1
0
 public function setUp()
 {
     $this->pdo = new \PDO("mysql:host=127.0.0.1;dbname=tests", 'root', '');
     $this->pdo->setAttribute(\PDO::ATTR_ERRMODE, \PDO::ERRMODE_EXCEPTION);
     $this->pdo->exec('SET NAMES utf8');
     /**
      * Table cars; SQLCommand
      */
     $table = new CarTable($this->pdo);
     $this->carsSqlCommand = new SQLCommand($table->getTableName(), CarEntity::getColumns());
 }
Example #2
0
 /**
  * @covers ::getColumns
  */
 public function testGetColumns()
 {
     $expected = ['id' => EntityProperty::UUID, 'make' => ['type' => EntityProperty::STRING, 'length' => 64], 'model' => ['type' => EntityProperty::STRING, 'length' => 64], 'horsepower' => ['type' => EntityProperty::INTEGER, 'signed' => false], 'doors' => ['type' => EntityProperty::ENUM, 'values' => ['TWO', 'FOUR']], 'released' => EntityProperty::DATE, 'modified' => EntityProperty::DATETIME, 'created' => EntityProperty::DATETIME];
     $this->assertSame($expected, CarEntity::getColumns());
 }