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

Commit

Permalink
Merge branch 'hotfix/7476'
Browse files Browse the repository at this point in the history
  • Loading branch information
weierophinney committed May 4, 2015
2 parents ac95d66 + 33f924f commit 24a6cea
Show file tree
Hide file tree
Showing 23 changed files with 53 additions and 53 deletions.
2 changes: 1 addition & 1 deletion test/Helper/CycleTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@ public function tearDown()
public function testCycleMethodReturnsObjectInstance()
{
$cycle = $this->helper->__invoke();
$this->assertTrue($cycle instanceof Helper\Cycle);
$this->assertInstanceOf('Zend\View\Helper\Cycle', $cycle);
}

public function testAssignAndGetValues()
Expand Down
2 changes: 1 addition & 1 deletion test/Helper/DoctypeTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,7 @@ public function tearDown()
public function testDoctypeMethodReturnsObjectInstance()
{
$doctype = $this->helper->__invoke();
$this->assertTrue($doctype instanceof Helper\Doctype);
$this->assertInstanceOf('Zend\View\Helper\Doctype', $doctype);
}

public function testPassingDoctypeSetsDoctype()
Expand Down
4 changes: 2 additions & 2 deletions test/Helper/EscapeCssTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,7 @@ public function testGetEscaperCreatesDefaultInstanceWithCorrectEncoding()
{
$this->helper->setEncoding('BIG5-HKSCS');
$escaper = $this->helper->getEscaper();
$this->assertTrue($escaper instanceof \Zend\Escaper\Escaper);
$this->assertInstanceOf('Zend\Escaper\Escaper', $escaper);
$this->assertEquals('big5-hkscs', $escaper->getEncoding());
}

Expand All @@ -60,7 +60,7 @@ public function testSettingEscaperObjectAlsoSetsEncoding()
$escaper = new \Zend\Escaper\Escaper('big5-hkscs');
$this->helper->setEscaper($escaper);
$escaper = $this->helper->getEscaper();
$this->assertTrue($escaper instanceof \Zend\Escaper\Escaper);
$this->assertInstanceOf('Zend\Escaper\Escaper', $escaper);
$this->assertEquals('big5-hkscs', $escaper->getEncoding());
}

Expand Down
4 changes: 2 additions & 2 deletions test/Helper/EscapeHtmlAttrTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,7 @@ public function testGetEscaperCreatesDefaultInstanceWithCorrectEncoding()
{
$this->helper->setEncoding('BIG5-HKSCS');
$escaper = $this->helper->getEscaper();
$this->assertTrue($escaper instanceof \Zend\Escaper\Escaper);
$this->assertInstanceOf('Zend\Escaper\Escaper', $escaper);
$this->assertEquals('big5-hkscs', $escaper->getEncoding());
}

Expand All @@ -60,7 +60,7 @@ public function testSettingEscaperObjectAlsoSetsEncoding()
$escaper = new \Zend\Escaper\Escaper('big5-hkscs');
$this->helper->setEscaper($escaper);
$escaper = $this->helper->getEscaper();
$this->assertTrue($escaper instanceof \Zend\Escaper\Escaper);
$this->assertInstanceOf('Zend\Escaper\Escaper', $escaper);
$this->assertEquals('big5-hkscs', $escaper->getEncoding());
}

Expand Down
4 changes: 2 additions & 2 deletions test/Helper/EscapeHtmlTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,7 @@ public function testGetEscaperCreatesDefaultInstanceWithCorrectEncoding()
{
$this->helper->setEncoding('BIG5-HKSCS');
$escaper = $this->helper->getEscaper();
$this->assertTrue($escaper instanceof \Zend\Escaper\Escaper);
$this->assertInstanceOf('Zend\Escaper\Escaper', $escaper);
$this->assertEquals('big5-hkscs', $escaper->getEncoding());
}

Expand All @@ -60,7 +60,7 @@ public function testSettingEscaperObjectAlsoSetsEncoding()
$escaper = new \Zend\Escaper\Escaper('big5-hkscs');
$this->helper->setEscaper($escaper);
$escaper = $this->helper->getEscaper();
$this->assertTrue($escaper instanceof \Zend\Escaper\Escaper);
$this->assertInstanceOf('Zend\Escaper\Escaper', $escaper);
$this->assertEquals('big5-hkscs', $escaper->getEncoding());
}

Expand Down
4 changes: 2 additions & 2 deletions test/Helper/EscapeJsTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,7 @@ public function testGetEscaperCreatesDefaultInstanceWithCorrectEncoding()
{
$this->helper->setEncoding('BIG5-HKSCS');
$escaper = $this->helper->getEscaper();
$this->assertTrue($escaper instanceof \Zend\Escaper\Escaper);
$this->assertInstanceOf('Zend\Escaper\Escaper', $escaper);
$this->assertEquals('big5-hkscs', $escaper->getEncoding());
}

Expand All @@ -60,7 +60,7 @@ public function testSettingEscaperObjectAlsoSetsEncoding()
$escaper = new \Zend\Escaper\Escaper('big5-hkscs');
$this->helper->setEscaper($escaper);
$escaper = $this->helper->getEscaper();
$this->assertTrue($escaper instanceof \Zend\Escaper\Escaper);
$this->assertInstanceOf('Zend\Escaper\Escaper', $escaper);
$this->assertEquals('big5-hkscs', $escaper->getEncoding());
}

Expand Down
4 changes: 2 additions & 2 deletions test/Helper/EscapeUrlTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,7 @@ public function testGetEscaperCreatesDefaultInstanceWithCorrectEncoding()
{
$this->helper->setEncoding('BIG5-HKSCS');
$escaper = $this->helper->getEscaper();
$this->assertTrue($escaper instanceof \Zend\Escaper\Escaper);
$this->assertInstanceOf('Zend\Escaper\Escaper', $escaper);
$this->assertEquals('big5-hkscs', $escaper->getEncoding());
}

Expand All @@ -60,7 +60,7 @@ public function testSettingEscaperObjectAlsoSetsEncoding()
$escaper = new \Zend\Escaper\Escaper('big5-hkscs');
$this->helper->setEscaper($escaper);
$escaper = $this->helper->getEscaper();
$this->assertTrue($escaper instanceof \Zend\Escaper\Escaper);
$this->assertInstanceOf('Zend\Escaper\Escaper', $escaper);
$this->assertEquals('big5-hkscs', $escaper->getEncoding());
}

Expand Down
18 changes: 9 additions & 9 deletions test/Helper/FlashMessengerTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -86,11 +86,11 @@ public function testCanRetrieveMessages()

$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->assertNotEmpty($helper('default'));
$this->assertNotEmpty($helper('info'));
$this->assertNotEmpty($helper('success'));
$this->assertNotEmpty($helper('warning'));
$this->assertNotEmpty($helper('error'));

$this->assertTrue($this->plugin->hasMessages());
$this->assertTrue($this->plugin->hasInfoMessages());
Expand All @@ -110,10 +110,10 @@ public function testCanRetrieveCurrentMessages()

$this->seedCurrentMessages();

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

$this->assertFalse($this->plugin->hasCurrentMessages());
$this->assertFalse($this->plugin->hasCurrentInfoMessages());
Expand Down
2 changes: 1 addition & 1 deletion test/Helper/HeadLinkTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,7 @@ public function tearDown()
public function testHeadLinkReturnsObjectInstance()
{
$placeholder = $this->helper->__invoke();
$this->assertTrue($placeholder instanceof Helper\HeadLink);
$this->assertInstanceOf('Zend\View\Helper\HeadLink', $placeholder);
}

public function testPrependThrowsExceptionWithoutArrayArgument()
Expand Down
10 changes: 5 additions & 5 deletions test/Helper/HeadMetaTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -67,7 +67,7 @@ public function handleErrors($errno, $errstr)
public function testHeadMetaReturnsObjectInstance()
{
$placeholder = $this->helper->__invoke();
$this->assertTrue($placeholder instanceof Helper\HeadMeta);
$this->assertInstanceOf('Zend\View\Helper\HeadMeta', $placeholder);
}

public function testAppendPrependAndSetThrowExceptionsWhenNonMetaValueProvided()
Expand Down Expand Up @@ -213,9 +213,9 @@ public function testCanBuildMetaTagsWithAttributes()

$this->assertObjectHasAttribute('modifiers', $value);
$modifiers = $value->modifiers;
$this->assertTrue(array_key_exists('lang', $modifiers));
$this->assertArrayHasKey('lang', $modifiers);
$this->assertEquals('us_en', $modifiers['lang']);
$this->assertTrue(array_key_exists('scheme', $modifiers));
$this->assertArrayHasKey('scheme', $modifiers);
$this->assertEquals('foo', $modifiers['scheme']);
}

Expand Down Expand Up @@ -253,7 +253,7 @@ public function testToStringWhenInvalidKeyProvidedShouldConvertThrownException()
set_error_handler(array($this, 'handleErrors'));
$string = @$this->helper->toString();
$this->assertEquals('', $string);
$this->assertTrue(is_string($this->error));
$this->assertInternalType('string', $this->error);
}

public function testHeadMetaHelperCreatesItemEntry()
Expand All @@ -272,7 +272,7 @@ 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));
$this->assertArrayHasKey(100, $values);
$item = $values[100];
$this->assertEquals('foo', $item->content);
$this->assertEquals('name', $item->type);
Expand Down
4 changes: 2 additions & 2 deletions test/Helper/HeadScriptTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,7 @@ public function tearDown()
public function testHeadScriptReturnsObjectInstance()
{
$placeholder = $this->helper->__invoke();
$this->assertTrue($placeholder instanceof Helper\HeadScript);
$this->assertInstanceOf('Zend\View\Helper\HeadScript', $placeholder);
}

public function testSetPrependAppendAndOffsetSetThrowExceptionsOnInvalidItems()
Expand Down Expand Up @@ -272,7 +272,7 @@ public function testToStringRendersValidHtml()

$doc = new \DOMDocument;
$dom = $doc->loadHtml($string);
$this->assertTrue($dom !== false);
$this->assertTrue($dom);
}

public function testCapturingCapturesToObject()
Expand Down
16 changes: 8 additions & 8 deletions test/Helper/HeadStyleTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,7 @@ public function tearDown()
public function testHeadStyleReturnsObjectInstance()
{
$placeholder = $this->helper->__invoke();
$this->assertTrue($placeholder instanceof Helper\HeadStyle);
$this->assertInstanceOf('Zend\View\Helper\HeadStyle', $placeholder);
}

public function testAppendPrependAndSetThrowExceptionsWhenNonStyleValueProvided()
Expand Down Expand Up @@ -93,7 +93,7 @@ public function testOverloadAppendStyleAppendsStyleToStack()
$this->assertEquals($i + 1, count($values));
$item = $values[$i];

$this->assertTrue($item instanceof \stdClass);
$this->assertInstanceOf('stdClass', $item);
$this->assertObjectHasAttribute('content', $item);
$this->assertObjectHasAttribute('attributes', $item);
$this->assertEquals($string, $item->content);
Expand All @@ -110,7 +110,7 @@ public function testOverloadPrependStylePrependsStyleToStack()
$this->assertEquals($i + 1, count($values));
$item = array_shift($values);

$this->assertTrue($item instanceof \stdClass);
$this->assertInstanceOf('stdClass', $item);
$this->assertObjectHasAttribute('content', $item);
$this->assertObjectHasAttribute('attributes', $item);
$this->assertEquals($string, $item->content);
Expand All @@ -129,7 +129,7 @@ public function testOverloadSetOversitesStack()
$this->assertEquals(1, count($values));
$item = array_shift($values);

$this->assertTrue($item instanceof \stdClass);
$this->assertInstanceOf('stdClass', $item);
$this->assertObjectHasAttribute('content', $item);
$this->assertObjectHasAttribute('attributes', $item);
$this->assertEquals($string, $item->content);
Expand Down Expand Up @@ -204,9 +204,9 @@ public function testHeadStyleProxiesProperly()
->__invoke($style3, 'APPEND');
$this->assertEquals(3, count($this->helper));
$values = $this->helper->getArrayCopy();
$this->assertTrue((bool) strstr($values[0]->content, $style2));
$this->assertTrue((bool) strstr($values[1]->content, $style1));
$this->assertTrue((bool) strstr($values[2]->content, $style3));
$this->assertContains($values[0]->content, $style2);
$this->assertContains($values[1]->content, $style1);
$this->assertContains($values[2]->content, $style3);
}

public function testToStyleGeneratesValidHtml()
Expand All @@ -221,7 +221,7 @@ public function testToStyleGeneratesValidHtml()
$html = $this->helper->toString();
$doc = new \DOMDocument;
$dom = $doc->loadHtml($html);
$this->assertTrue(($dom !== false));
$this->assertTrue($dom);

$styles = substr_count($html, '<style type="text/css"');
$this->assertEquals(3, $styles);
Expand Down
4 changes: 2 additions & 2 deletions test/Helper/HeadTitleTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,7 @@ public function tearDown()
public function testHeadTitleReturnsObjectInstance()
{
$placeholder = $this->helper->__invoke();
$this->assertTrue($placeholder instanceof Helper\HeadTitle);
$this->assertInstanceOf('Zend\View\Helper\HeadTitle', $placeholder);
}

public function testCanSetTitleViaHeadTitle()
Expand Down Expand Up @@ -218,7 +218,7 @@ public function testCanPrependTitlesUsingDefaultAttachOrder()
*/
public function testReturnTypeDefaultAttachOrder()
{
$this->assertTrue($this->helper->setDefaultAttachOrder('PREPEND') instanceof Helper\HeadTitle);
$this->assertInstanceOf('Zend\View\Helper\HeadTitle', $this->helper->setDefaultAttachOrder('PREPEND'));
$this->assertEquals('PREPEND', $this->helper->getDefaultAttachOrder());
}
}
2 changes: 1 addition & 1 deletion test/Helper/InlineScriptTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -56,6 +56,6 @@ public function tearDown()
public function testInlineScriptReturnsObjectInstance()
{
$placeholder = $this->helper->__invoke();
$this->assertTrue($placeholder instanceof Helper\InlineScript);
$this->assertInstanceOf('Zend\View\Helper\InlineScript', $placeholder);
}
}
2 changes: 1 addition & 1 deletion test/Helper/JsonTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,7 @@ public function testJsonHelperSetsResponseHeader()
public function testJsonHelperReturnsJsonEncodedString()
{
$data = $this->helper->__invoke('foobar');
$this->assertTrue(is_string($data));
$this->assertInternalType('string', $data);
$this->assertEquals('foobar', JsonFormatter::decode($data));
}
}
4 changes: 2 additions & 2 deletions test/Helper/Navigation/NavigationTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -442,13 +442,13 @@ public function testRenderInvisibleItem()

$render = $this->_helper->menu()->render($container);

$this->assertFalse(strpos($render, 'p2'));
$this->assertNotContains('p2', $render);

$this->_helper->menu()->setRenderInvisible();

$render = $this->_helper->menu()->render($container);

$this->assertTrue(strpos($render, 'p2') !== false);
$this->assertContains('p2', $render);
}

public function testMultipleNavigations()
Expand Down
4 changes: 2 additions & 2 deletions test/Helper/Placeholder/ContainerTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -427,7 +427,7 @@ public function testIndentationIsHonored()

$lis = substr_count($string, "\n <li>");
$this->assertEquals(3, $lis);
$this->assertTrue((bool) strstr($string, " <ul>\n"), $string);
$this->assertTrue((bool) strstr($string, "\n </ul>"));
$this->assertContains(" <ul>\n", $string, $string);
$this->assertContains("\n </ul>", $string, $string);
}
}
6 changes: 3 additions & 3 deletions test/Helper/Placeholder/RegistryTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -66,7 +66,7 @@ public function testCreateContainerCreatesDefaultContainerClass()
{
$this->assertFalse($this->registry->containerExists('foo'));
$container = $this->registry->createContainer('foo');
$this->assertTrue($container instanceof Container);
$this->assertInstanceOf('Zend\View\Helper\Placeholder\Container', $container);
}

/**
Expand All @@ -76,7 +76,7 @@ public function testGetContainerCreatesContainerIfNonExistent()
{
$this->assertFalse($this->registry->containerExists('foo'));
$container = $this->registry->getContainer('foo');
$this->assertTrue($container instanceof Container\AbstractContainer);
$this->assertInstanceOf('Zend\View\Helper\Placeholder\Container\AbstractContainer', $container);
$this->assertTrue($this->registry->containerExists('foo'));
}

Expand Down Expand Up @@ -135,7 +135,7 @@ public function testUsingCustomContainerClassCreatesContainersOfCustomClass()
{
$this->registry->setContainerClass('ZendTest\View\Helper\Placeholder\MockContainer');
$container = $this->registry->createContainer('foo');
$this->assertTrue($container instanceof MockContainer);
$this->assertInstanceOf('ZendTest\View\Helper\Placeholder\MockContainer', $container);
}

/**
Expand Down
2 changes: 1 addition & 1 deletion test/Model/ViewModelTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -232,7 +232,7 @@ public function testTemplateIsEmptyByDefault()
{
$model = new ViewModel();
$template = $model->getTemplate();
$this->assertTrue(empty($template));
$this->assertEmpty($template);
}

public function testTemplateIsMutable()
Expand Down
2 changes: 1 addition & 1 deletion test/PhpRendererTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -173,7 +173,7 @@ public function testCanSpecifyArrayForVarsAndGetAlwaysArrayObject()
{
$vars = array('foo' => 'bar');
$this->renderer->setVars($vars);
$this->assertTrue($this->renderer->vars() instanceof Variables);
$this->assertInstanceOf('Zend\View\Variables', $this->renderer->vars());
}

/**
Expand Down
2 changes: 1 addition & 1 deletion test/Strategy/FeedStrategyTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -83,7 +83,7 @@ protected function assertResponseNotInjected()
{
$content = $this->response->getContent();
$headers = $this->response->getHeaders();
$this->assertTrue(empty($content));
$this->assertEmpty($content);
$this->assertFalse($headers->has('content-type'));
}

Expand Down
2 changes: 1 addition & 1 deletion test/Strategy/JsonStrategyTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -87,7 +87,7 @@ protected function assertResponseNotInjected()
{
$content = $this->response->getContent();
$headers = $this->response->getHeaders();
$this->assertTrue(empty($content));
$this->assertEmpty($content);
$this->assertFalse($headers->has('content-type'));
}

Expand Down
2 changes: 1 addition & 1 deletion test/Strategy/PhpRendererStrategyTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ protected function assertResponseNotInjected()
{
$content = $this->response->getContent();
$headers = $this->response->getHeaders();
$this->assertTrue(empty($content));
$this->assertEmpty($content);
$this->assertFalse($headers->has('content-type'));
}

Expand Down

0 comments on commit 24a6cea

Please sign in to comment.