Esempio n. 1
0
 public function testToArrayKeys()
 {
     $in = $out = array();
     foreach ($this->toArrayKeyProvider() as $call) {
         $in[] = $call[0];
         $out[] = $call[1];
     }
     $this->assertSame($out, FormUtil::toArrayKeys($in));
 }
 /**
  * @param array $array
  *
  * @return array
  *
  * @throws UnexpectedTypeException if the given value is not an array
  */
 public function transform($array)
 {
     if (null === $array) {
         return array();
     }
     if (!is_array($array)) {
         throw new UnexpectedTypeException($array, 'array');
     }
     return FormUtil::toArrayKeys($array);
 }