public function testIteratorWithMessages() { $data = ['One', 'Two', 'Three']; $this->sessionStub->set('messages', [10 => $data]); $this->container->rewind(); $this->assertTrue($this->container->valid()); $this->assertSame('One', $this->container->current()); $this->assertSame(0, $this->container->key()); $this->container->next(); $this->assertTrue($this->container->valid()); $this->assertSame('Two', $this->container->current()); $this->assertSame(1, $this->container->key()); $this->container->next(); $this->assertTrue($this->container->valid()); $this->assertSame('Three', $this->container->current()); $this->assertSame(2, $this->container->key()); $this->container->next(); $this->assertFalse($this->container->valid()); }
/** * @param HttpContextContainer $httpContextContainer * @param array $types */ public function __construct(HttpContextContainer $httpContextContainer, array $types = []) { $this->types = new Types($types); parent::__construct($httpContextContainer); }