public function testConstructorAndIteration() { $pageTypes = array('blog' => new Blog(), 'home' => new Home()); $collection = new Collection($pageTypes); $this->assertSame(count($pageTypes), $collection->count()); foreach ($collection as $pageType) { $this->assertSame($pageTypes[$pageType->getName()], $pageType); } }