コード例 #1
0
ファイル: FizzOpsTest.php プロジェクト: skylarkelty/fizz
 public function setUp()
 {
     // Although it seems horribly inefficient, it ensures each test is clean
     // and fresh. It's for tests, so accuracy > efficiency
     try {
         SkylarK\Fizz\FizzConfig::setDB("mysql:dbname=testdb;host=127.0.0.1", "travis", "");
     } catch (PDOException $e) {
         die($e->getMessage());
         exit(0);
     }
     // Create a new table for each test
     $object = new SkylarK\Fizz\Util\FizzMigrate("Example");
     $object->addField("key", "int(11)");
     $object->commit();
 }
コード例 #2
0
ファイル: FizzTest.php プロジェクト: skylarkelty/fizz
 public function setUp()
 {
     // Although it seems horribly inefficient, it ensures each test is clean
     // and fresh. It's for tests, so accuracy > efficiency
     try {
         SkylarK\Fizz\FizzConfig::setDB("mysql:dbname=testdb;host=127.0.0.1", "travis", "");
     } catch (PDOException $e) {
         die($e->getMessage());
         exit(0);
     }
     // Drop each test's table
     SkylarK\Fizz\Util\FizzOps::drop("Demo");
     // Create table
     $object = new SkylarK\Fizz\Util\FizzMigrate("Demo");
     $object->addField("key", "varchar(125)");
     $object->addField("value", "text");
     $this->assertTrue($object->commit());
 }
コード例 #3
0
ファイル: FizzMigrateTest.php プロジェクト: skylarkelty/fizz
 public function __construct($tableName, $errorMode = 0)
 {
     parent::__construct($tableName, self::$ERROR_MODE_PRINT);
 }