Esempio n. 1
0
 public function test02()
 {
     # array_dict - array to flattened dictionary
     $this->assertEquals(['Apples' => 'One', 'Beets' => 2, 'Candy.start' => 'now', 'Candy.end' => 'then'], Util::array_flatten($this->source_array));
     ### s_to_a - string to array
     $this->assertEquals(['apples', 'beets', 'candy.start', 'candy.end'], Util::array_from_str('apples beets candy.start candy.end'));
     ### s_to_aa - string to associative array
     $this->assertEquals(['apples' => 10, 'beets' => 'nope', 'candy.start' => 'now', 'candy.end' => 'never'], Util::assoc_from_str('apples:10, beets:nope, candy.start:now, candy.end:never'));
 }