public function testSortPrimaryKeysWithOrder()
 {
     $this->map->set('c', 'foo', 'value1');
     $this->map->set('c', 'bar', 'value2');
     $this->map->set('a', 'baz', 'value3');
     $this->map->set('b', 'bam', 'value4');
     $this->map->sortPrimaryKeys(array('b', 'c', 'a', 'd'));
     $this->assertSame(array('b' => array('bam' => 'value4'), 'c' => array('foo' => 'value1', 'bar' => 'value2'), 'a' => array('baz' => 'value3')), $this->map->toArray());
 }
 /**
  * Sorts the map primary keys, if necessary.
  */
 private function lazySortPrimaryKeys()
 {
     $this->map->sortPrimaryKeys();
     $this->primaryKeysSorted = true;
 }