/** * We've got a map of strings, and we should be able to call keys on it * and get the keys out, even if the keys aren't themselves strings. */ public function test_keys_with_exotic_keys() { $map = new MapOfStrings(); $map['foo'] = 'bar'; $map[function () { }] = 'baz'; $map->keys(); }
public function test_fluent_conversion() { $words = new MapOfStrings(['foo', 'bar']); $this->assertSame(6, $words->map('strlen($_0)')->into(new MapOfInts())->sum()); }