public function testCustomBuilder() { Phactory::reset(); Phactory::builder(new CustomBuilder()); $cake = Phactory::cake(); $this->assertInstanceOf('CustomObject', $cake); }
protected function tearDown() { Phactory::reset(); $this->pdo->exec("DROP TABLE users"); $this->pdo->exec("DROP TABLE images"); $this->pdo->exec("DROP TABLE users_images"); }
protected function tearDown() { Phactory::reset(); $this->db->users->drop(); $this->db->roles->drop(); $this->mongo->close(); }
public function testCustomDependencyClass() { Phactory::reset(); Phactory::$dependencyClass = 'CustomDependency'; $entry = Phactory::entry(array('budget' => Phactory::budget(array('amount' => null)))); $this->assertNull($entry->budget_amount); }
public function testMultiLevelDependencyWithMethodCalls() { Phactory::reset(); Phactory::builder(new TestBuilder()); $entry = Phactory::entry(); $this->assertSame($entry->designer, $entry->design->attachment->creator()); }
public static function setUpBeforeClass() { // create a db connection and tell Phactory to use it $mongo = new Mongo(); Phactory::setConnection($mongo->test_db); // reset any existing blueprints and empty any tables Phactory has used Phactory::reset(); }
public function testTriggersWithVariation() { Phactory::reset(); Phactory::triggers(new FrameworkTriggers()); $account = Phactory::account('system'); $this->assertEquals($account->id, 1); $this->assertTrue($account->beforeSave); $this->assertTrue($account->afterSave); $this->assertTrue($account->systemBeforeSave); $this->assertTrue($account->systemAfterSave); }
public function setup() { Phactory::reset(); }
/** * Tears down the fixture, for example, closes a network connection. * This method is called after a test is executed. */ protected function tearDown() { Phactory::reset(); $this->pdo->exec("DROP TABLE `users`"); $this->pdo->exec("DROP TABLE `roles`"); }
public function setup() { Phactory::reset(); Phactory::builder(new OreBuilder()); }