/**
  * @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);
 }
예제 #2
0
 private function getConnection()
 {
     if (is_null($this->connection)) {
         $this->connection = $this->mapper->getConnection($this);
     }
     return $this->connection;
 }
 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);
 }
 private function generateObjectCollection()
 {
     $dataObject = new Account();
     return $this->mapper->find($dataObject);
 }