Пример #1
0
 public function testOverloadingOffsetSetWritesToSpecifiedIndex()
 {
     $this->helper->offsetSetStyle(100, 'foobar');
     $values = $this->helper->getArrayCopy();
     $this->assertEquals(1, count($values));
     $this->assertTrue(isset($values[100]));
     $item = $values[100];
     $this->assertContains('foobar', $item->content);
 }
Пример #2
0
 /**
  * @issue ZF-5435
  */
 public function testContainerMaintainsCorrectOrderOfItems()
 {
     $style1 = 'a {display: none;}';
     $this->helper->offsetSetStyle(10, $style1);
     $style2 = 'h1 {font-weight: bold}';
     $this->helper->offsetSetStyle(5, $style2);
     $test = $this->helper->toString();
     $expected = '<style type="text/css" media="screen">' . PHP_EOL . '<!--' . PHP_EOL . $style2 . PHP_EOL . '-->' . PHP_EOL . '</style>' . PHP_EOL . '<style type="text/css" media="screen">' . PHP_EOL . '<!--' . PHP_EOL . $style1 . PHP_EOL . '-->' . PHP_EOL . '</style>';
     $this->assertEquals($expected, $test);
 }