public function setUp() { $this->_introspector = new SkylarK\Fizz\Util\Introspect(); // 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("Example"); }
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(); }
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()); }