/** * @group ZF-5435 */ public function testContainerMaintainsCorrectOrderOfItems() { $this->helper->offsetSetName(1, 'keywords', 'foo'); $this->helper->offsetSetName(10, 'description', 'foo'); $this->helper->offsetSetHttpEquiv(20, 'pragma', 'baz'); $this->helper->offsetSetHttpEquiv(5, 'Cache-control', 'baz'); $test = $this->helper->toString(); $expected = '<meta name="keywords" content="foo" />' . PHP_EOL . '<meta http-equiv="Cache-control" content="baz" />' . PHP_EOL . '<meta name="description" content="foo" />' . PHP_EOL . '<meta http-equiv="pragma" content="baz" />'; $this->assertEquals($expected, $test); }
public function testOverloadingOffsetInsertsAtOffset() { $this->helper->offsetSetName(100, 'keywords', 'foo'); $values = $this->helper->getArrayCopy(); $this->assertEquals(1, count($values)); $this->assertTrue(array_key_exists(100, $values)); $item = $values[100]; $this->assertEquals('foo', $item->content); $this->assertEquals('name', $item->type); $this->assertEquals('keywords', $item->name); }