Ejemplo n.º 1
0
 /**
  * @testdox A collection proxy is iterable with foreach
  */
 public function testIterable()
 {
     $collection = new NormalizedCollection();
     $collection->add('one', 1);
     $collection->add('two', 2);
     $proxy = new CollectionProxyDummy($collection);
     $actual = [];
     foreach ($proxy as $k => $v) {
         $actual[$k] = $v;
     }
     $this->assertSame(['one' => 1, 'two' => 2], $actual);
 }
 /**
  * @testdox asConfig() returns the elements in lexical order
  */
 public function testAsConfigLexicalOrder()
 {
     $collection = new NormalizedCollection();
     $collection->add('foo', 'foo');
     $collection->add('bar', 'bar');
     $this->assertSame(['bar' => 'bar', 'foo' => 'foo'], $collection->asConfig());
 }