Exemplo n.º 1
0
 /**
  * @depends	testInitialState
  * @return	null
  */
 public function testAddScriptGetScriptsAsStrings()
 {
     $script1 = 'myfile.js';
     $script2 = 'myOtherfile.js';
     $script3 = 'yourfile.js';
     $tag1 = $this->factory->createScriptTag($script1);
     $tag2 = $this->factory->createScriptTag($script2);
     $tag3 = $this->factory->createScriptTag($script3);
     $this->assertEquals(0, $this->head->getScriptCount());
     $this->assertSame($this->head, $this->head->addScript($script1));
     $this->assertEquals(1, $this->head->getScriptCount());
     $expected = array($tag1);
     $this->assertEquals($expected, $this->head->getScripts());
     $this->assertSame($this->head, $this->head->addScript($script2));
     $this->assertEquals(2, $this->head->getScriptCount());
     $expected = array($tag1, $tag2);
     $this->assertEquals($expected, $this->head->getScripts());
     $this->assertSame($this->head, $this->head->addScript($script3));
     $this->assertEquals(3, $this->head->getScriptCount());
     $expected = array($tag1, $tag2, $tag3);
     $this->assertEquals($expected, $this->head->getScripts());
 }