/** * @depends testConstruction */ public function testRegisterMap(ObjectMapper $mapper) { $mapper->registerMap(new AccountMap(), $this->connection); $mapper->registerMap(new CharacterMap(), $this->connection); $mapRegistry = TestHelper::getObjProp($mapper, 'mapRegistry'); $this->assertArrayHasKey('DreamblazeNet\\CrazyDataMapper\\Tests\\Objects\\Account', $mapRegistry); $this->assertArrayHasKey('DreamblazeNet\\CrazyDataMapper\\Tests\\Objects\\Character', $mapRegistry); }
private function generateMapper() { $connection1 = new \DreamblazeNet\CrazyDataMapper\Database\PdoDatabaseConnection(null); $conn = $this->getConnection(); $connection1->setConnection($conn->getConnection()); $connection2 = new \DreamblazeNet\CrazyDataMapper\Database\PdoDatabaseConnection(null); $connection2->setConnection($this->getConnection()->getConnection()); $mapper = new ObjectMapper(); $mapper->registerMap(new AccountMap(), $connection1); $mapper->registerMap(new CharacterMap(), $connection2); $mapper->registerMap(new GuildMembershipMap(), $connection2); $mapper->registerMap(new GuildMap(), $connection2); $this->mapper = $mapper; }
private function initMapper() { $this->mapper = new ObjectMapper(); $this->mapper->registerMap(new AccountMap(), $this->connection); $this->mapper->registerMap(new CharacterMap(), $this->connection); $this->mapper->registerMap(new GuildMembershipMap(), $this->connection); $this->mapper->registerMap(new GuildMap(), $this->connection); }
private function generateObjectCollection() { $this->connection = new DummyDatabaseConnection('blub', 'testUser', 'testPass'); $this->mapper = new ObjectMapper(); $dataObject = new Dummy(); $this->mapper->registerMap(new DummyMap(), $this->connection); $this->mapper->registerMap(new MinionMap(), $this->connection); return $this->mapper->find($dataObject); }