Skip to content
This repository has been archived by the owner on Jan 31, 2020. It is now read-only.

Commit

Permalink
Revert "Merge branch 'superdweebie-rand-bugfix'"
Browse files Browse the repository at this point in the history
This reverts commit 002ce3dee6107f2c71af8e7ce0ed1f43693ddadf, reversing
changes made to 0023a96e4756112661c11dbf4e293f4be110809a.

Note: we will need to revert this revert when merging develop to master for the
2.3.0 release. See http://git-scm.com/blog/2010/03/02/undoing-merges.html - the
section on "Reverting the Revert," for details.
  • Loading branch information
weierophinney committed Aug 19, 2013
2 parents b621b46 + 76c4d1c commit 83cbc8a
Show file tree
Hide file tree
Showing 11 changed files with 3 additions and 113 deletions.
2 changes: 1 addition & 1 deletion composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@
"zendframework/zend-navigation": "Zend\\Navigation component",
"zendframework/zend-paginator": "Zend\\Paginator component",
"zendframework/zend-permissions-acl": "Zend\\Permissions\\Acl component",
"zendframework/zend-servicemanager": "Zend\\ServiceManager component",
"zendframework/zend-servicemanager": "self.version",
"zendframework/zend-uri": "Zend\\Uri component"
},
"extra": {
Expand Down
1 change: 0 additions & 1 deletion src/Helper/FlashMessenger.php
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,6 @@ class FlashMessenger extends AbstractTranslatorHelper implements ServiceLocatorA
PluginFlashMessenger::NAMESPACE_ERROR => 'error',
PluginFlashMessenger::NAMESPACE_SUCCESS => 'success',
PluginFlashMessenger::NAMESPACE_DEFAULT => 'default',
PluginFlashMessenger::NAMESPACE_WARNING => 'warning',
);

/**
Expand Down
6 changes: 1 addition & 5 deletions src/Helper/HeadLink.php
Original file line number Diff line number Diff line change
Expand Up @@ -304,11 +304,7 @@ public function itemToString(stdClass $item)
&& !empty($attributes['conditionalStylesheet'])
&& is_string($attributes['conditionalStylesheet']))
{
// inner wrap with comment end and start if !IE
if (str_replace(' ', '', $attributes['conditionalStylesheet']) === '!IE') {
$link = '<!-->' . $link . '<!--';
}
$link = '<!--[if ' . $attributes['conditionalStylesheet'] . ']>' . $link . '<![endif]-->';
$link = '<!--[if ' . $attributes['conditionalStylesheet'] . ']> ' . $link . '<![endif]-->';
}

return $link;
Expand Down
4 changes: 0 additions & 4 deletions src/Helper/HeadMeta.php
Original file line number Diff line number Diff line change
Expand Up @@ -269,10 +269,6 @@ public function itemToString(stdClass $item)
&& !empty($item->modifiers['conditional'])
&& is_string($item->modifiers['conditional']))
{
// inner wrap with comment end and start if !IE
if (str_replace(' ', '', $item->modifiers['conditional']) === '!IE') {
$meta = '<!-->' . $meta . '<!--';
}
$meta = '<!--[if ' . $this->escape($item->modifiers['conditional']) . ']>' . $meta . '<![endif]-->';
}

Expand Down
4 changes: 0 additions & 4 deletions src/Helper/HeadScript.php
Original file line number Diff line number Diff line change
Expand Up @@ -408,10 +408,6 @@ public function itemToString($item, $indent, $escapeStart, $escapeEnd)
&& !empty($item->attributes['conditional'])
&& is_string($item->attributes['conditional']))
{
// inner wrap with comment end and start if !IE
if (str_replace(' ', '', $item->attributes['conditional']) === '!IE') {
$html = '<!-->' . $html . '<!--';
}
$html = $indent . '<!--[if ' . $item->attributes['conditional'] . ']>' . $html . '<![endif]-->';
} else {
$html = $indent . $html;
Expand Down
6 changes: 1 addition & 5 deletions src/Helper/HeadStyle.php
Original file line number Diff line number Diff line change
Expand Up @@ -333,11 +333,7 @@ public function itemToString(stdClass $item, $indent)
. '</style>';

if (null == $escapeStart && null == $escapeEnd) {
// inner wrap with comment end and start if !IE
if (str_replace(' ', '', $item->attributes['conditional']) === '!IE') {
$html = '<!-->' . $html . '<!--';
}
$html = '<!--[if ' . $item->attributes['conditional'] . ']>' . $html . '<![endif]-->';
$html = '<!--[if ' . $item->attributes['conditional'] . ']> ' . $html . '<![endif]-->';
}

return $html;
Expand Down
6 changes: 0 additions & 6 deletions test/Helper/FlashMessengerTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,6 @@ public function seedMessages()
$helper->addMessage('bar');
$helper->addInfoMessage('bar-info');
$helper->addSuccessMessage('bar-success');
$helper->addWarningMessage('bar-warning');
$helper->addErrorMessage('bar-error');
unset($helper);
}
Expand Down Expand Up @@ -74,21 +73,18 @@ public function testCanRetrieveMessages()
$this->assertFalse($helper()->hasMessages());
$this->assertFalse($helper()->hasInfoMessages());
$this->assertFalse($helper()->hasSuccessMessages());
$this->assertFalse($helper()->hasWarningMessages());
$this->assertFalse($helper()->hasErrorMessages());

$this->seedMessages();

$this->assertTrue(count($helper('default')) > 0);
$this->assertTrue(count($helper('info')) > 0);
$this->assertTrue(count($helper('success')) > 0);
$this->assertTrue(count($helper('warning')) > 0);
$this->assertTrue(count($helper('error')) > 0);

$this->assertTrue($this->plugin->hasMessages());
$this->assertTrue($this->plugin->hasInfoMessages());
$this->assertTrue($this->plugin->hasSuccessMessages());
$this->assertTrue($this->plugin->hasWarningMessages());
$this->assertTrue($this->plugin->hasErrorMessages());
}

Expand All @@ -97,15 +93,13 @@ public function testCanProxyAndRetrieveMessagesFromPluginController()
$this->assertFalse($this->helper->hasMessages());
$this->assertFalse($this->helper->hasInfoMessages());
$this->assertFalse($this->helper->hasSuccessMessages());
$this->assertFalse($this->helper->hasWarningMessages());
$this->assertFalse($this->helper->hasErrorMessages());

$this->seedMessages();

$this->assertTrue($this->helper->hasMessages());
$this->assertTrue($this->helper->hasInfoMessages());
$this->assertTrue($this->helper->hasSuccessMessages());
$this->assertTrue($this->helper->hasWarningMessages());
$this->assertTrue($this->helper->hasErrorMessages());
}

Expand Down
26 changes: 0 additions & 26 deletions test/Helper/HeadLinkTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -277,32 +277,6 @@ public function testConditionalStylesheetCreationOccursWhenRequested()
$this->assertContains('<![endif]-->', $string);
}

public function testConditionalStylesheetCreationNoIE()
{
$this->helper->setStylesheet('/styles.css', 'screen', '!IE');
$item = $this->helper->getValue();
$this->assertObjectHasAttribute('conditionalStylesheet', $item);
$this->assertEquals('!IE', $item->conditionalStylesheet);

$string = $this->helper->toString();
$this->assertContains('/styles.css', $string);
$this->assertContains('<!--[if !IE]><!--><', $string);
$this->assertContains('<!--<![endif]-->', $string);
}

public function testConditionalStylesheetCreationNoIEWidthSpaces()
{
$this->helper->setStylesheet('/styles.css', 'screen', '! IE');
$item = $this->helper->getValue();
$this->assertObjectHasAttribute('conditionalStylesheet', $item);
$this->assertEquals('! IE', $item->conditionalStylesheet);

$string = $this->helper->toString();
$this->assertContains('/styles.css', $string);
$this->assertContains('<!--[if ! IE]><!--><', $string);
$this->assertContains('<!--<![endif]-->', $string);
}

public function testSettingAlternateWithTooFewArgsRaisesException()
{
try {
Expand Down
15 changes: 0 additions & 15 deletions test/Helper/HeadMetaTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -530,19 +530,4 @@ public function testConditional()
$this->assertRegExp("|<!\[endif\]-->$|", $html);
}

public function testConditionalNoIE()
{
$html = $this->helper->appendHttpEquiv('foo', 'bar', array('conditional' => '!IE'))->toString();

$this->assertContains('<!--[if !IE]><!--><', $html);
$this->assertContains('<!--<![endif]-->', $html);
}

public function testConditionalNoIEWidthSpace()
{
$html = $this->helper->appendHttpEquiv('foo', 'bar', array('conditional' => '! IE'))->toString();

$this->assertContains('<!--[if ! IE]><!--><', $html);
$this->assertContains('<!--<![endif]-->', $html);
}
}
24 changes: 0 additions & 24 deletions test/Helper/HeadScriptTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -379,30 +379,6 @@ public function testConditionalScriptWidthIndentation()
$this->assertContains(' <!--[if lt IE 7]>', $test);
}

public function testConditionalScriptNoIE()
{
$this->helper->setAllowArbitraryAttributes(true);
$this->helper->appendFile(
'/js/foo.js', 'text/javascript', array('conditional' => '!IE')
);
$test = $this->helper->toString();

$this->assertContains('<!--[if !IE]><!--><', $test);
$this->assertContains('<!--<![endif]-->', $test);
}

public function testConditionalScriptNoIEWidthSpace()
{
$this->helper->setAllowArbitraryAttributes(true);
$this->helper->appendFile(
'/js/foo.js', 'text/javascript', array('conditional' => '! IE')
);
$test = $this->helper->toString();

$this->assertContains('<!--[if ! IE]><!--><', $test);
$this->assertContains('<!--<![endif]-->', $test);
}

/**
* @issue ZF-5435
*/
Expand Down
22 changes: 0 additions & 22 deletions test/Helper/HeadStyleTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -362,28 +362,6 @@ public function testConditionalScript()
$this->assertContains('<!--[if lt IE 7]>', $test);
}

public function testConditionalScriptNoIE()
{
$this->helper->appendStyle('
a {
display: none;
}', array('media' => 'screen,projection', 'conditional' => '!IE'));
$test = $this->helper->toString();
$this->assertContains('<!--[if !IE]><!--><', $test);
$this->assertContains('<!--<![endif]-->', $test);
}

public function testConditionalScriptNoIEWidthSpace()
{
$this->helper->appendStyle('
a {
display: none;
}', array('media' => 'screen,projection', 'conditional' => '! IE'));
$test = $this->helper->toString();
$this->assertContains('<!--[if ! IE]><!--><', $test);
$this->assertContains('<!--<![endif]-->', $test);
}

/**
* @issue ZF-5435
*/
Expand Down

0 comments on commit 83cbc8a

Please sign in to comment.