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

Commit 138cd03

Browse files
committedNov 16, 2016
CS fixes
1 parent 8f7b8f7 commit 138cd03

39 files changed

+222
-51
lines changed
 

‎phpcs.xml

+1
Original file line numberDiff line numberDiff line change
@@ -5,4 +5,5 @@
55
<!-- Paths to check -->
66
<file>src</file>
77
<file>test</file>
8+
<exclude-pattern>*/_templates/*</exclude-pattern>
89
</ruleset>

‎src/Helper/Doctype.php

+2
Original file line numberDiff line numberDiff line change
@@ -131,6 +131,7 @@ public function __toString()
131131
*/
132132
protected static function registerDefaultDoctypes()
133133
{
134+
// @codingStandardsIgnoreStart
134135
static::$registeredDoctypes = new ArrayObject([
135136
'doctypes' => [
136137
self::XHTML11 => '<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1//EN" "http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd">',
@@ -147,6 +148,7 @@ protected static function registerDefaultDoctypes()
147148
self::HTML5 => '<!DOCTYPE html>',
148149
],
149150
]);
151+
// @codingStandardsIgnoreEnd
150152
}
151153

152154
/**

‎src/Helper/HeadLink.php

+7-1
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,7 @@
1313
use Zend\View;
1414
use Zend\View\Exception;
1515

16+
// @codingStandardsIgnoreStart
1617
/**
1718
* Zend_Layout_View_Helper_HeadLink
1819
*
@@ -28,6 +29,7 @@
2829
* @method HeadLink prependAlternate($href, $type, $title, $extras = array())
2930
* @method HeadLink setAlternate($href, $type, $title, $extras = array())
3031
*/
32+
// @codingStandardsIgnoreEnd
3133
class HeadLink extends Placeholder\Container\AbstractStandalone
3234
{
3335
/**
@@ -143,7 +145,11 @@ public function __invoke(array $attributes = null, $placement = Placeholder\Cont
143145
*/
144146
public function __call($method, $args)
145147
{
146-
if (preg_match('/^(?P<action>set|(ap|pre)pend|offsetSet)(?P<type>Stylesheet|Alternate|Prev|Next)$/', $method, $matches)) {
148+
if (preg_match(
149+
'/^(?P<action>set|(ap|pre)pend|offsetSet)(?P<type>Stylesheet|Alternate|Prev|Next)$/',
150+
$method,
151+
$matches
152+
)) {
147153
$argc = count($args);
148154
$action = $matches['action'];
149155
$type = $matches['type'];

‎src/Helper/HeadMeta.php

+5-1
Original file line numberDiff line numberDiff line change
@@ -120,7 +120,11 @@ public function __invoke(
120120
*/
121121
public function __call($method, $args)
122122
{
123-
if (preg_match('/^(?P<action>set|(pre|ap)pend|offsetSet)(?P<type>Name|HttpEquiv|Property|Itemprop)$/', $method, $matches)) {
123+
if (preg_match(
124+
'/^(?P<action>set|(pre|ap)pend|offsetSet)(?P<type>Name|HttpEquiv|Property|Itemprop)$/',
125+
$method,
126+
$matches
127+
)) {
124128
$action = $matches['action'];
125129
$type = $this->normalizeType($matches['type']);
126130
$argc = count($args);

‎src/HelperPluginManager.php

+1-1
Original file line numberDiff line numberDiff line change
@@ -153,7 +153,7 @@ class HelperPluginManager extends AbstractPluginManager
153153
Helper\BasePath::class => InvokableFactory::class,
154154
Helper\Cycle::class => InvokableFactory::class,
155155
Helper\DeclareVars::class => InvokableFactory::class,
156-
Helper\Doctype::class => InvokableFactory::class, // overridden by a factory in ViewHelperManagerFactory
156+
Helper\Doctype::class => InvokableFactory::class, // overridden in ViewHelperManagerFactory
157157
Helper\EscapeHtml::class => InvokableFactory::class,
158158
Helper\EscapeHtmlAttr::class => InvokableFactory::class,
159159
Helper\EscapeJs::class => InvokableFactory::class,

‎src/Renderer/ConsoleRenderer.php

+2
Original file line numberDiff line numberDiff line change
@@ -22,10 +22,12 @@
2222
*/
2323
class ConsoleRenderer implements RendererInterface, TreeRendererInterface
2424
{
25+
// @codingStandardsIgnoreStart
2526
/**
2627
* @var FilterChain
2728
*/
2829
protected $__filterChain;
30+
// @codingStandardsIgnoreEnd
2931

3032
/**
3133
* Constructor.

‎src/Renderer/PhpRenderer.php

+2
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,7 @@
2222
use Zend\View\Resolver\TemplatePathStack;
2323
use Zend\View\Variables;
2424

25+
// @codingStandardsIgnoreStart
2526
/**
2627
* Class for Zend\View\Strategy\PhpRendererStrategy to help enforce private constructs.
2728
*
@@ -131,6 +132,7 @@ class PhpRenderer implements Renderer, TreeRendererInterface
131132
* @var array Temporary variable stack; used when variables passed to render()
132133
*/
133134
private $__varsCache = [];
135+
// @codingStandardsIgnoreEnd
134136

135137
/**
136138
* Constructor.

‎src/Stream.php

+14
Original file line numberDiff line numberDiff line change
@@ -54,8 +54,10 @@ class Stream
5454
* @param $opened_path
5555
* @return bool
5656
*/
57+
// @codingStandardsIgnoreStart
5758
public function stream_open($path, $mode, $options, &$opened_path)
5859
{
60+
// @codingStandardsIgnoreEnd
5961
// get the view script source
6062
$path = str_replace('zend.view://', '', $path);
6163
$this->data = file_get_contents($path);
@@ -91,8 +93,10 @@ public function stream_open($path, $mode, $options, &$opened_path)
9193
*
9294
* @return array
9395
*/
96+
// @codingStandardsIgnoreStart
9497
public function url_stat()
9598
{
99+
// @codingStandardsIgnoreEnd
96100
return $this->stat;
97101
}
98102

@@ -102,8 +106,10 @@ public function url_stat()
102106
* @param int $count
103107
* @return string
104108
*/
109+
// @codingStandardsIgnoreStart
105110
public function stream_read($count)
106111
{
112+
// @codingStandardsIgnoreEnd
107113
$ret = substr($this->data, $this->pos, $count);
108114
$this->pos += strlen($ret);
109115
return $ret;
@@ -114,8 +120,10 @@ public function stream_read($count)
114120
*
115121
* @return int
116122
*/
123+
// @codingStandardsIgnoreStart
117124
public function stream_tell()
118125
{
126+
// @codingStandardsIgnoreEnd
119127
return $this->pos;
120128
}
121129

@@ -124,8 +132,10 @@ public function stream_tell()
124132
*
125133
* @return bool
126134
*/
135+
// @codingStandardsIgnoreStart
127136
public function stream_eof()
128137
{
138+
// @codingStandardsIgnoreEnd
129139
return $this->pos >= strlen($this->data);
130140
}
131141

@@ -134,8 +144,10 @@ public function stream_eof()
134144
*
135145
* @return array
136146
*/
147+
// @codingStandardsIgnoreStart
137148
public function stream_stat()
138149
{
150+
// @codingStandardsIgnoreEnd
139151
return $this->stat;
140152
}
141153

@@ -146,8 +158,10 @@ public function stream_stat()
146158
* @param $whence
147159
* @return bool
148160
*/
161+
// @codingStandardsIgnoreStart
149162
public function stream_seek($offset, $whence)
150163
{
164+
// @codingStandardsIgnoreEnd
151165
switch ($whence) {
152166
case SEEK_SET:
153167
if ($offset < strlen($this->data) && $offset >= 0) {

‎test/Helper/DeclareVarsTest.php

+2-1
Original file line numberDiff line numberDiff line change
@@ -31,9 +31,10 @@ public function tearDown()
3131
{
3232
unset($this->view);
3333
}
34-
34+
// @codingStandardsIgnoreStart
3535
protected function _declareVars()
3636
{
37+
// @codingStandardsIgnoreEnd
3738
$this->view->plugin('declareVars')->__invoke(
3839
'varName1',
3940
'varName2',

‎test/Helper/DoctypeTest.php

+12
Original file line numberDiff line numberDiff line change
@@ -81,7 +81,9 @@ public function testIsXhtmlReturnsTrueForXhtmlDoctypes()
8181
$this->assertTrue($doctype->isXhtml());
8282
}
8383

84+
// @codingStandardsIgnoreStart
8485
$doctype = $this->helper->__invoke('<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://framework.zend.com/foo/DTD/xhtml1-custom.dtd">');
86+
// @codingStandardsIgnoreEnd
8587
$this->assertEquals('CUSTOM_XHTML', $doctype->getDoctype());
8688
$this->assertTrue($doctype->isXhtml());
8789
}
@@ -100,7 +102,9 @@ public function testIsXhtmlReturnsFalseForNonXhtmlDoctypes()
100102
$this->assertFalse($doctype->isXhtml());
101103
}
102104

105+
// @codingStandardsIgnoreStart
103106
$doctype = $this->helper->__invoke('<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 10.0 Strict//EN" "http://framework.zend.com/foo/DTD/html10-custom.dtd">');
107+
// @codingStandardsIgnoreEnd
104108
$this->assertEquals('CUSTOM', $doctype->getDoctype());
105109
$this->assertFalse($doctype->isXhtml());
106110
}
@@ -156,8 +160,10 @@ public function testIsRdfa()
156160
$this->assertFalse($this->helper->__invoke($type)->isRdfa());
157161
}
158162

163+
// @codingStandardsIgnoreStart
159164
// custom doctype
160165
$doctype = $this->helper->__invoke('<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 10.0 Strict//EN" "http://framework.zend.com/foo/DTD/html10-custom.dtd">');
166+
// @codingStandardsIgnoreEnd
161167
$this->assertFalse($doctype->isRdfa());
162168
}
163169

@@ -170,14 +176,18 @@ public function testCanRegisterCustomHtml5Doctype()
170176

171177
public function testCanRegisterCustomXhtmlDoctype()
172178
{
179+
// @codingStandardsIgnoreStart
173180
$doctype = $this->helper->__invoke('<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://framework.zend.com/foo/DTD/xhtml1-custom.dtd">');
181+
// @codingStandardsIgnoreEnd
174182
$this->assertEquals('CUSTOM_XHTML', $doctype->getDoctype());
175183
$this->assertTrue($doctype->isXhtml());
176184
}
177185

178186
public function testCanRegisterCustomHtmlDoctype()
179187
{
188+
// @codingStandardsIgnoreStart
180189
$doctype = $this->helper->__invoke('<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 10.0 Strict//EN" "http://framework.zend.com/foo/DTD/html10-custom.dtd">');
190+
// @codingStandardsIgnoreEnd
181191
$this->assertEquals('CUSTOM', $doctype->getDoctype());
182192
$this->assertFalse($doctype->isXhtml());
183193
}
@@ -195,6 +205,8 @@ public function testStringificationReturnsDoctypeString()
195205
{
196206
$doctype = $this->helper->__invoke(Helper\Doctype::XHTML1_STRICT);
197207
$string = $doctype->__toString();
208+
// @codingStandardsIgnoreStart
198209
$this->assertEquals('<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">', $string);
210+
// @codingStandardsIgnoreEnd
199211
}
200212
}

‎test/Helper/FlashMessengerTest.php

+4
Original file line numberDiff line numberDiff line change
@@ -346,7 +346,9 @@ public function testCanDisplayListOfMessagesCustomisedByConfigSeparator()
346346
$helperPluginManager = $services->get('ViewHelperManager');
347347
$helper = $helperPluginManager->get('flashmessenger');
348348

349+
// @codingStandardsIgnoreStart
349350
$displayInfoAssertion = '<div><ul><li class="foo-baz foo-bar">foo</li><li class="foo-baz foo-bar">bar</li></ul></div>';
351+
// @codingStandardsIgnoreEnd
350352
$displayInfo = $helper->render('default', ['foo-baz', 'foo-bar']);
351353
$this->assertEquals($displayInfoAssertion, $displayInfo);
352354
}
@@ -368,7 +370,9 @@ public function testCanDisplayListOfCurrentMessagesCustomisedByConfigSeparator()
368370
$helperPluginManager = $services->get('ViewHelperManager');
369371
$helper = $helperPluginManager->get('flashmessenger');
370372

373+
// @codingStandardsIgnoreStart
371374
$displayInfoAssertion = '<div><ul><li class="foo-baz foo-bar">foo</li><li class="foo-baz foo-bar">bar</li></ul></div>';
375+
// @codingStandardsIgnoreEnd
372376
$displayInfo = $helper->renderCurrent('default', ['foo-baz', 'foo-bar']);
373377
$this->assertEquals($displayInfoAssertion, $displayInfo);
374378
}

‎test/Helper/GravatarTest.php

+7-1
Original file line numberDiff line numberDiff line change
@@ -169,7 +169,11 @@ public function testImgAttribs()
169169
{
170170
$this->assertRegExp(
171171
'/class="gravatar" title="Gravatar"/',
172-
$this->helper->__invoke("example@example.com", [], ['class' => 'gravatar', 'title' => 'Gravatar'])->__toString()
172+
$this->helper->__invoke(
173+
"example@example.com",
174+
[],
175+
['class' => 'gravatar', 'title' => 'Gravatar']
176+
)->__toString()
173177
);
174178
}
175179

@@ -179,8 +183,10 @@ public function testImgAttribs()
179183
public function testGravatarOptions()
180184
{
181185
$this->assertRegExp(
186+
// @codingStandardsIgnoreStart
182187
'#src="http\&\#x3A\;\&\#x2F\;\&\#x2F\;www.gravatar.com\&\#x2F\;avatar\&\#x2F\;[a-z0-9]{32}&\#x3F;s&\#x3D;125&amp;d&\#x3D;wavatar&amp;r&\#x3D;pg"#',
183188
$this->helper->__invoke("example@example.com", ['rating' => 'pg', 'imgSize' => 125, 'defaultImg' => 'wavatar', 'secure' => false])->__toString()
189+
// @codingStandardsIgnoreEnd
184190
);
185191
}
186192

‎test/Helper/HeadLinkTest.php

+5-1
Original file line numberDiff line numberDiff line change
@@ -380,7 +380,11 @@ public function testSetAlternateWithExtras()
380380

381381
public function testAppendStylesheetWithExtras()
382382
{
383-
$this->helper->appendStylesheet(['href' => '/bar/baz', 'conditionalStylesheet' => false, 'extras' => ['id' => 'my_link_tag']]);
383+
$this->helper->appendStylesheet([
384+
'href' => '/bar/baz',
385+
'conditionalStylesheet' => false,
386+
'extras' => ['id' => 'my_link_tag']
387+
]);
384388
$test = $this->helper->toString();
385389
$this->assertContains('id="my_link_tag"', $test);
386390
}

‎test/Helper/HeadMetaTest.php

+20-3
Original file line numberDiff line numberDiff line change
@@ -94,16 +94,20 @@ public function testAppendPrependAndSetThrowExceptionsWhenNonMetaValueProvided()
9494
}
9595
}
9696

97+
// @codingStandardsIgnoreStart
9798
protected function _inflectAction($type)
9899
{
100+
// @codingStandardsIgnoreEnd
99101
$type = str_replace('-', ' ', $type);
100102
$type = ucwords($type);
101103
$type = str_replace(' ', '', $type);
102104
return $type;
103105
}
104106

107+
// @codingStandardsIgnoreStart
105108
protected function _testOverloadAppend($type)
106109
{
110+
// @codingStandardsIgnoreEnd
107111
$action = 'append' . $this->_inflectAction($type);
108112
$string = 'foo';
109113
for ($i = 0; $i < 3; ++$i) {
@@ -122,8 +126,10 @@ protected function _testOverloadAppend($type)
122126
}
123127
}
124128

129+
// @codingStandardsIgnoreStart
125130
protected function _testOverloadPrepend($type)
126131
{
132+
// @codingStandardsIgnoreEnd
127133
$action = 'prepend' . $this->_inflectAction($type);
128134
$string = 'foo';
129135
for ($i = 0; $i < 3; ++$i) {
@@ -142,8 +148,10 @@ protected function _testOverloadPrepend($type)
142148
}
143149
}
144150

151+
// @codingStandardsIgnoreStart
145152
protected function _testOverloadSet($type)
146153
{
154+
// @codingStandardsIgnoreEnd
147155
$setAction = 'set' . $this->_inflectAction($type);
148156
$appendAction = 'append' . $this->_inflectAction($type);
149157
$string = 'foo';
@@ -312,7 +320,8 @@ public function testSetNameDoesntClobber()
312320
$view->plugin('headMeta')->setName('keywords', 'bat');
313321

314322
$this->assertEquals(
315-
'<meta http-equiv="pragma" content="bar" />' . PHP_EOL . '<meta http-equiv="Cache-control" content="baz" />' . PHP_EOL . '<meta name="keywords" content="bat" />',
323+
'<meta http-equiv="pragma" content="bar" />' . PHP_EOL . '<meta http-equiv="Cache-control" content="baz" />'
324+
. PHP_EOL . '<meta name="keywords" content="bat" />',
316325
$view->plugin('headMeta')->toString()
317326
);
318327
}
@@ -330,7 +339,9 @@ public function testSetNameDoesntClobberPart2()
330339
$view->plugin('headMeta')->setName('keywords', 'bar');
331340

332341
$this->assertEquals(
333-
'<meta name="description" content="foo" />' . PHP_EOL . '<meta http-equiv="pragma" content="baz" />' . PHP_EOL . '<meta http-equiv="Cache-control" content="baz" />' . PHP_EOL . '<meta name="keywords" content="bar" />',
342+
'<meta name="description" content="foo" />' . PHP_EOL . '<meta http-equiv="pragma" content="baz" />'
343+
. PHP_EOL . '<meta http-equiv="Cache-control" content="baz" />' . PHP_EOL
344+
. '<meta name="keywords" content="bar" />',
334345
$view->plugin('headMeta')->toString()
335346
);
336347
}
@@ -343,7 +354,13 @@ public function testPlacesMetaTagsInProperOrder()
343354
{
344355
$view = new View();
345356
$view->plugin('headMeta')->setName('keywords', 'foo');
346-
$view->plugin('headMeta')->__invoke('some content', 'bar', 'name', [], \Zend\View\Helper\Placeholder\Container\AbstractContainer::PREPEND);
357+
$view->plugin('headMeta')->__invoke(
358+
'some content',
359+
'bar',
360+
'name',
361+
[],
362+
\Zend\View\Helper\Placeholder\Container\AbstractContainer::PREPEND
363+
);
347364

348365
$this->assertEquals(
349366
'<meta name="bar" content="some content" />' . PHP_EOL . '<meta name="keywords" content="foo" />',

‎test/Helper/HeadScriptTest.php

+14-1
Original file line numberDiff line numberDiff line change
@@ -84,13 +84,17 @@ public function testSetPrependAppendAndOffsetSetThrowExceptionsOnInvalidItems()
8484
}
8585
}
8686

87+
// @codingStandardsIgnoreStart
8788
protected function _inflectAction($type)
8889
{
90+
// @codingStandardsIgnoreEnd
8991
return ucfirst(strtolower($type));
9092
}
9193

94+
// @codingStandardsIgnoreStart
9295
protected function _testOverloadAppend($type)
9396
{
97+
// @codingStandardsIgnoreEnd
9498
$action = 'append' . $this->_inflectAction($type);
9599
$string = 'foo';
96100
for ($i = 0; $i < 3; ++$i) {
@@ -107,8 +111,10 @@ protected function _testOverloadAppend($type)
107111
}
108112
}
109113

114+
// @codingStandardsIgnoreStart
110115
protected function _testOverloadPrepend($type)
111116
{
117+
// @codingStandardsIgnoreEnd
112118
$action = 'prepend' . $this->_inflectAction($type);
113119
$string = 'foo';
114120
for ($i = 0; $i < 3; ++$i) {
@@ -126,8 +132,10 @@ protected function _testOverloadPrepend($type)
126132
}
127133
}
128134

135+
// @codingStandardsIgnoreStart
129136
protected function _testOverloadSet($type)
130137
{
138+
// @codingStandardsIgnoreEnd
131139
$action = 'set' . $this->_inflectAction($type);
132140
$string = 'foo';
133141
for ($i = 0; $i < 3; ++$i) {
@@ -145,8 +153,10 @@ protected function _testOverloadSet($type)
145153
$this->assertEquals('text/javascript', $values[0]->type);
146154
}
147155

156+
// @codingStandardsIgnoreStart
148157
protected function _testOverloadOffsetSet($type)
149158
{
159+
// @codingStandardsIgnoreEnd
150160
$action = 'offsetSet' . $this->_inflectAction($type);
151161
$string = 'foo';
152162
$this->helper->$action(5, $string);
@@ -360,7 +370,10 @@ public function testCannotNestCaptures()
360370
public function testTurnOffAutoEscapeDoesNotEncodeAmpersand()
361371
{
362372
$this->helper->setAutoEscape(false)->appendFile('test.js?id=123&foo=bar');
363-
$this->assertEquals('<script type="text/javascript" src="test.js?id=123&foo=bar"></script>', $this->helper->toString());
373+
$this->assertEquals(
374+
'<script type="text/javascript" src="test.js?id=123&foo=bar"></script>',
375+
$this->helper->toString()
376+
);
364377
}
365378

366379
public function testConditionalScript()

‎test/Helper/HtmlFlashTest.php

+2
Original file line numberDiff line numberDiff line change
@@ -45,7 +45,9 @@ public function testMakeHtmlFlash()
4545
{
4646
$htmlFlash = $this->helper->__invoke('/path/to/flash.swf');
4747

48+
// @codingStandardsIgnoreStart
4849
$objectStartElement = '<object data="&#x2F;path&#x2F;to&#x2F;flash.swf" type="application&#x2F;x-shockwave-flash">';
50+
// @codingStandardsIgnoreEnd
4951

5052
$this->assertContains($objectStartElement, $htmlFlash);
5153
$this->assertContains('</object>', $htmlFlash);

‎test/Helper/HtmlObjectTest.php

+4-1
Original file line numberDiff line numberDiff line change
@@ -62,7 +62,10 @@ public function testMakeHtmlObjectWithAttribsWithoutParams()
6262

6363
$htmlObject = $this->helper->__invoke('datastring', 'typestring', $attribs);
6464

65-
$this->assertContains('<object data="datastring" type="typestring" attribkey1="attribvalue1" attribkey2="attribvalue2">', $htmlObject);
65+
$this->assertContains(
66+
'<object data="datastring" type="typestring" attribkey1="attribvalue1" attribkey2="attribvalue2">',
67+
$htmlObject
68+
);
6669
$this->assertContains('</object>', $htmlObject);
6770
}
6871

‎test/Helper/IdentityTest.php

+4-1
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,10 @@ public function testGetIdentity()
2929
$identity->setUsername('a username');
3030
$identity->setPassword('a password');
3131

32-
$authenticationService = new AuthenticationService(new NonPersistentStorage, new TestAsset\AuthenticationAdapter);
32+
$authenticationService = new AuthenticationService(
33+
new NonPersistentStorage,
34+
new TestAsset\AuthenticationAdapter
35+
);
3336

3437
$identityHelper = new IdentityHelper;
3538
$identityHelper->setAuthenticationService($authenticationService);

‎test/Helper/Navigation/AbstractHelperTest.php

+2
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,7 @@
1111

1212
class AbstractHelperTest extends AbstractTest
1313
{
14+
// @codingStandardsIgnoreStart
1415
/**
1516
* Class name for view helper to test
1617
*
@@ -24,6 +25,7 @@ class AbstractHelperTest extends AbstractTest
2425
* @var \Zend\View\Helper\Navigation\Breadcrumbs
2526
*/
2627
protected $_helper;
28+
// @codingStandardsIgnoreEnd
2729

2830
protected function tearDown()
2931
{

‎test/Helper/Navigation/AbstractTest.php

+10
Original file line numberDiff line numberDiff line change
@@ -34,6 +34,7 @@ abstract class AbstractTest extends \PHPUnit_Framework_TestCase
3434
*/
3535
protected $serviceManager;
3636

37+
// @codingStandardsIgnoreStart
3738
/**
3839
* Path to files needed for test
3940
*
@@ -77,6 +78,7 @@ abstract class AbstractTest extends \PHPUnit_Framework_TestCase
7778
protected $_nav3;
7879

7980
private $_oldControllerDir;
81+
// @codingStandardsIgnoreEnd
8082

8183
/**
8284
* Prepares the environment before running a test
@@ -166,8 +168,10 @@ protected function setUp()
166168
* @param string $file
167169
* @return string
168170
*/
171+
// @codingStandardsIgnoreStart
169172
protected function _getExpected($file)
170173
{
174+
// @codingStandardsIgnoreEnd
171175
return file_get_contents($this->_files . '/expected/' . $file);
172176
}
173177

@@ -176,8 +180,10 @@ protected function _getExpected($file)
176180
*
177181
* @return Acl
178182
*/
183+
// @codingStandardsIgnoreStart
179184
protected function _getAcl()
180185
{
186+
// @codingStandardsIgnoreEnd
181187
$acl = new Acl();
182188

183189
$acl->addRole(new GenericRole('guest'));
@@ -204,8 +210,10 @@ protected function _getAcl()
204210
*
205211
* @return Translator
206212
*/
213+
// @codingStandardsIgnoreStart
207214
protected function _getTranslator()
208215
{
216+
// @codingStandardsIgnoreEnd
209217
$loader = new TestAsset\ArrayTranslator();
210218
$loader->translations = [
211219
'Page 1' => 'Side 1',
@@ -227,8 +235,10 @@ protected function _getTranslator()
227235
*
228236
* @return Translator
229237
*/
238+
// @codingStandardsIgnoreStart
230239
protected function _getTranslatorWithTextDomain()
231240
{
241+
// @codingStandardsIgnoreEnd
232242
$loader1 = new TestAsset\ArrayTranslator();
233243
$loader1->translations = [
234244
'Page 1' => 'TextDomain1 1',

‎test/Helper/Navigation/BreadcrumbsTest.php

+2
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,7 @@
2020
*/
2121
class BreadcrumbsTest extends AbstractTest
2222
{
23+
// @codingStandardsIgnoreStart
2324
/**
2425
* Class name for view helper to test.
2526
*
@@ -33,6 +34,7 @@ class BreadcrumbsTest extends AbstractTest
3334
* @var \Zend\View\Helper\Navigation\Breadcrumbs
3435
*/
3536
protected $_helper;
37+
// @codingStandardsIgnoreEnd
3638

3739
public function testCanRenderStraightFromServiceAlias()
3840
{

‎test/Helper/Navigation/LinksTest.php

+6
Original file line numberDiff line numberDiff line change
@@ -26,6 +26,7 @@
2626
*/
2727
class LinksTest extends AbstractTest
2828
{
29+
// @codingStandardsIgnoreStart
2930
/**
3031
* Class name for view helper to test
3132
*
@@ -42,6 +43,7 @@ class LinksTest extends AbstractTest
4243

4344
private $_doctypeHelper;
4445
private $_oldDoctype;
46+
// @codingStandardsIgnoreEnd
4547

4648
public function setUp()
4749
{
@@ -601,8 +603,10 @@ public function testFindAllRelations()
601603
$this->assertEquals($expected, $actual);
602604
}
603605

606+
// @codingStandardsIgnoreStart
604607
private function _getFlags()
605608
{
609+
// @codingStandardsIgnoreEnd
606610
return [
607611
Navigation\Links::RENDER_ALTERNATE => 'alternate',
608612
Navigation\Links::RENDER_STYLESHEET => 'stylesheet',
@@ -720,8 +724,10 @@ public function testSetMinDepth()
720724
* @param string $file
721725
* @return string
722726
*/
727+
// @codingStandardsIgnoreStart
723728
protected function _getExpected($file)
724729
{
730+
// @codingStandardsIgnoreEnd
725731
return str_replace("\n", PHP_EOL, parent::_getExpected($file));
726732
}
727733
}

‎test/Helper/Navigation/MenuTest.php

+6
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,7 @@
1717
*/
1818
class MenuTest extends AbstractTest
1919
{
20+
// @codingStandardsIgnoreStart
2021
/**
2122
* Class name for view helper to test.
2223
*
@@ -30,6 +31,7 @@ class MenuTest extends AbstractTest
3031
* @var \Zend\View\Helper\Navigation\Menu
3132
*/
3233
protected $_helper;
34+
// @codingStandardsIgnoreEnd
3335

3436
public function testCanRenderMenuFromServiceAlias()
3537
{
@@ -395,8 +397,10 @@ public function testOnlyActiveBranchNoParentsAndBothDepthsSpecified()
395397
$this->assertEquals($expected, $actual);
396398
}
397399

400+
// @codingStandardsIgnoreStart
398401
private function _setActive($label)
399402
{
403+
// @codingStandardsIgnoreEnd
400404
$container = $this->_helper->getContainer();
401405

402406
foreach ($container->findAllByActive(true) as $page) {
@@ -612,8 +616,10 @@ public function testRenderDeepestMenuWithPageClassToLi()
612616
*
613617
* @return string
614618
*/
619+
// @codingStandardsIgnoreStart
615620
protected function _getExpected($file)
616621
{
622+
// @codingStandardsIgnoreEnd
617623
return str_replace("\n", PHP_EOL, parent::_getExpected($file));
618624
}
619625
}

‎test/Helper/Navigation/NavigationTest.php

+6-1
Original file line numberDiff line numberDiff line change
@@ -27,6 +27,7 @@
2727
*/
2828
class NavigationTest extends AbstractTest
2929
{
30+
// @codingStandardsIgnoreStart
3031
/**
3132
* Class name for view helper to test
3233
*
@@ -40,6 +41,7 @@ class NavigationTest extends AbstractTest
4041
* @var \Zend\View\Helper\Navigation
4142
*/
4243
protected $_helper;
44+
// @codingStandardsIgnoreEnd
4345

4446
public function testHelperEntryPointWithoutAnyParams()
4547
{
@@ -382,8 +384,9 @@ public function testSetDefaultRoleThrowsExceptionWhenGivenAnArbitraryObject()
382384
$this->assertContains('$role must be', $e->getMessage());
383385
}
384386
}
385-
387+
// @codingStandardsIgnoreStart
386388
private $_errorMessage;
389+
// @codingStandardsIgnoreEnd
387390
public function toStringErrorHandler($code, $msg, $file, $line, array $c)
388391
{
389392
$this->_errorMessage = $msg;
@@ -605,8 +608,10 @@ public function testInjectsLazyInstantiatedPluginManagerWithCurrentServiceLocato
605608
* @param string $file
606609
* @return string
607610
*/
611+
// @codingStandardsIgnoreStart
608612
protected function _getExpected($file)
609613
{
614+
// @codingStandardsIgnoreEnd
610615
return str_replace("\n", PHP_EOL, parent::_getExpected($file));
611616
}
612617
}

‎test/Helper/Navigation/SitemapTest.php

+2
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,7 @@
2020
*/
2121
class SitemapTest extends AbstractTest
2222
{
23+
// @codingStandardsIgnoreStart
2324
protected $_oldServer = [];
2425

2526
/**
@@ -41,6 +42,7 @@ class SitemapTest extends AbstractTest
4142
* @var string
4243
*/
4344
private $_originaltimezone;
45+
// @codingStandardsIgnoreEnd
4446

4547
protected function setUp()
4648
{

‎test/Helper/PaginationControlTest.php

+7-1
Original file line numberDiff line numberDiff line change
@@ -20,12 +20,14 @@
2020
*/
2121
class PaginationControlTest extends \PHPUnit_Framework_TestCase
2222
{
23+
// @codingStandardsIgnoreStart
2324
/**
2425
* @var Helper\PaginationControl
2526
*/
2627
private $_viewHelper;
2728

2829
private $_paginator;
30+
// @codingStandardsIgnoreEnd
2931

3032
/**
3133
* Sets up the fixture, for example, open a network connection.
@@ -150,7 +152,11 @@ public function testAcceptsViewPartialInOtherModule()
150152
$this->assertInstanceOf(
151153
'Zend\View\Exception\RuntimeException',
152154
$e,
153-
sprintf('Expected View RuntimeException; received "%s" with message: %s', get_class($e), $e->getMessage())
155+
sprintf(
156+
'Expected View RuntimeException; received "%s" with message: %s',
157+
get_class($e),
158+
$e->getMessage()
159+
)
154160
);
155161
$this->assertContains('could not resolve', $e->getMessage());
156162
}

‎test/Helper/PartialTest.php

+1
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,7 @@
1313
use Zend\View\Helper\Partial;
1414
use Zend\View\Model\ViewModel;
1515
use Zend\View\Renderer\PhpRenderer as View;
16+
use ZendTest\View\Helper\TestAsset\Aggregate;
1617

1718
/**
1819
* Test class for Partial view helper.

‎test/Helper/Placeholder/RegistryTest.php

+9-20
Original file line numberDiff line numberDiff line change
@@ -102,14 +102,17 @@ public function testSetContainerCreatesRegistersContainerInstance()
102102
public function testContainerClassAccessorsSetState()
103103
{
104104
$this->assertEquals('Zend\View\Helper\Placeholder\Container', $this->registry->getContainerClass());
105-
$this->registry->setContainerClass('ZendTest\View\Helper\Placeholder\MockContainer');
106-
$this->assertEquals('ZendTest\View\Helper\Placeholder\MockContainer', $this->registry->getContainerClass());
105+
$this->registry->setContainerClass('ZendTest\View\Helper\TestAsset\MockContainer');
106+
$this->assertEquals(
107+
'ZendTest\View\Helper\TestAsset\MockContainer',
108+
$this->registry->getContainerClass()
109+
);
107110
}
108111

109112
public function testSetContainerClassThrowsExceptionWithInvalidContainerClass()
110113
{
111114
try {
112-
$this->registry->setContainerClass('ZendTest\View\Helper\Placeholder\BogusContainer');
115+
$this->registry->setContainerClass('ZendTest\View\Helper\TestAsset\BogusContainer');
113116
$this->fail('Invalid container classes should not be accepted');
114117
} catch (\Exception $e) {
115118
}
@@ -132,35 +135,21 @@ public function testDeleteContainerReturnsFalseIfContainerDoesNotExist()
132135

133136
public function testUsingCustomContainerClassCreatesContainersOfCustomClass()
134137
{
135-
$this->registry->setContainerClass('ZendTest\View\Helper\Placeholder\MockContainer');
138+
$this->registry->setContainerClass('ZendTest\View\Helper\TestAsset\MockContainer');
136139
$container = $this->registry->createContainer('foo');
137-
$this->assertInstanceOf('ZendTest\View\Helper\Placeholder\MockContainer', $container);
140+
$this->assertInstanceOf('ZendTest\View\Helper\TestAsset\MockContainer', $container);
138141
}
139142

140143
/**
141144
* @group ZF-10793
142145
*/
143146
public function testSetValueCreateContainer()
144147
{
145-
$this->registry->setContainerClass('ZendTest\View\Helper\Placeholder\MockContainer');
148+
$this->registry->setContainerClass('ZendTest\View\Helper\TestAsset\MockContainer');
146149
$data = [
147150
'ZF-10793'
148151
];
149152
$container = $this->registry->createContainer('foo', $data);
150153
$this->assertEquals(['ZF-10793'], $container->data);
151154
}
152155
}
153-
154-
class MockContainer extends Container\AbstractContainer
155-
{
156-
public $data = [];
157-
158-
public function __construct($data)
159-
{
160-
$this->data = $data;
161-
}
162-
}
163-
164-
class BogusContainer
165-
{
166-
}

‎test/Helper/Placeholder/StandaloneContainerTest.php

+3-14
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,7 @@
1111

1212
use Zend\View\Helper\Placeholder\Container;
1313
use Zend\View\Renderer\PhpRenderer as View;
14+
use ZendTest\View\Helper\TestAsset\Foo;
1415

1516
/**
1617
* Test class for Zend\View\Helper\Placeholder\Container.
@@ -99,8 +100,8 @@ public function testSetContainerClassThrowsInvalidArgumentException()
99100
*/
100101
public function testSetGetContainerClass()
101102
{
102-
$this->helper->setContainerClass('ZendTest\View\Helper\Placeholder\Bar');
103-
$this->assertEquals('ZendTest\View\Helper\Placeholder\Bar', $this->helper->getContainerClass());
103+
$this->helper->setContainerClass('ZendTest\View\Helper\TestAsset\Bar');
104+
$this->assertEquals('ZendTest\View\Helper\TestAsset\Bar', $this->helper->getContainerClass());
104105
}
105106

106107
/**
@@ -131,15 +132,3 @@ public function testContainerDoesNotPersistBetweenInstances()
131132
$this->assertContains('Bar', $test);
132133
}
133134
}
134-
135-
class Foo extends \Zend\View\Helper\Placeholder\Container\AbstractStandalone
136-
{
137-
protected $_regKey = 'foo';
138-
public function direct()
139-
{
140-
}
141-
}
142-
143-
class Bar extends \Zend\View\Helper\Placeholder\Container\AbstractContainer
144-
{
145-
}

‎test/Helper/RenderChildModelTest.php

+5-1
Original file line numberDiff line numberDiff line change
@@ -114,7 +114,11 @@ public function testRendersSequentialChildrenWithNestedChildren()
114114
$child1->addChild($nested);
115115

116116
$result = $this->renderer->render($this->parent);
117-
$this->assertRegExp('/Content:\s+Layout start\s+Content for layout\s+Layout end\s+Sidebar:\s+Second child/s', $result, $result);
117+
$this->assertRegExp(
118+
'/Content:\s+Layout start\s+Content for layout\s+Layout end\s+Sidebar:\s+Second child/s',
119+
$result,
120+
$result
121+
);
118122
}
119123

120124
public function testAttemptingToRenderWithNoCurrentModelRaisesException()

‎test/Helper/RenderToPlaceholderTest.php

+2
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,9 @@
1717
*/
1818
class RenderToPlaceholderTest extends \PHPUnit_Framework_TestCase
1919
{
20+
// @codingStandardsIgnoreStart
2021
protected $_view = null;
22+
// @codingStandardsIgnoreEnd
2123

2224
public function setUp()
2325
{

‎test/Helper/Aggregate.php ‎test/Helper/TestAsset/Aggregate.php

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
<?php
22

3-
namespace ZendTest\View\Helper;
3+
namespace ZendTest\View\Helper\TestAsset;
44

55
class Aggregate
66
{

‎test/Helper/TestAsset/Bar.php

+7
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
<?php
2+
3+
namespace ZendTest\View\Helper\TestAsset;
4+
5+
class Bar extends \Zend\View\Helper\Placeholder\Container\AbstractContainer
6+
{
7+
}
+7
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
<?php
2+
3+
namespace ZendTest\View\Helper\TestAsset;
4+
5+
class BogusContainer
6+
{
7+
}

‎test/Helper/TestAsset/Foo.php

+13
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
<?php
2+
3+
namespace ZendTest\View\Helper\TestAsset;
4+
5+
class Foo extends \Zend\View\Helper\Placeholder\Container\AbstractStandalone
6+
{
7+
// @codingStandardsIgnoreStart
8+
protected $_regKey = 'foo';
9+
// @codingStandardsIgnoreEnd
10+
public function direct()
11+
{
12+
}
13+
}

‎test/Helper/TestAsset/IteratorWithToArrayTestContainer.php

+2
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,9 @@
99

1010
class IteratorWithToArrayTestContainer
1111
{
12+
// @codingStandardsIgnoreStart
1213
protected $_info;
14+
// @codingStandardsIgnoreEnd
1315

1416
public function __construct(array $info)
1517
{
+15
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
<?php
2+
3+
namespace ZendTest\View\Helper\TestAsset;
4+
5+
use Zend\View\Helper\Placeholder\Container\AbstractContainer;
6+
7+
class MockContainer extends AbstractContainer
8+
{
9+
public $data = [];
10+
11+
public function __construct($data)
12+
{
13+
$this->data = $data;
14+
}
15+
}

‎test/HelperPluginManagerTest.php

+4
Original file line numberDiff line numberDiff line change
@@ -134,8 +134,10 @@ public function testIfHelperIsTranslatorAwareAndMvcTranslatorIsAvailableItWillIn
134134
$this->assertSame($translator, $helper->getTranslator());
135135
}
136136

137+
// @codingStandardsIgnoreStart
137138
public function testIfHelperIsTranslatorAwareAndMvcTranslatorIsUnavailableAndTranslatorIsAvailableItWillInjectTheTranslator()
138139
{
140+
// @codingStandardsIgnoreEnd
139141
$translator = new Translator();
140142
$config = new Config(['services' => [
141143
'Translator' => $translator,
@@ -147,8 +149,10 @@ public function testIfHelperIsTranslatorAwareAndMvcTranslatorIsUnavailableAndTra
147149
$this->assertSame($translator, $helper->getTranslator());
148150
}
149151

152+
// @codingStandardsIgnoreStart
150153
public function testIfHelperIsTranslatorAwareAndBothMvcTranslatorAndTranslatorAreUnavailableAndTranslatorInterfaceIsAvailableItWillInjectTheTranslator()
151154
{
155+
// @codingStandardsIgnoreEnd
152156
$translator = new Translator();
153157
$config = new Config(['services' => [
154158
'Zend\I18n\Translator\TranslatorInterface' => $translator,

‎test/Renderer/FeedRendererTest.php

+4-1
Original file line numberDiff line numberDiff line change
@@ -116,7 +116,10 @@ public function testNonStringNonModelArgumentRaisesException()
116116

117117
public function testSettingUnacceptableFeedTypeRaisesException()
118118
{
119-
$this->setExpectedException('Zend\View\Exception\InvalidArgumentException', 'expects a string of either "rss" or "atom"');
119+
$this->setExpectedException(
120+
'Zend\View\Exception\InvalidArgumentException',
121+
'expects a string of either "rss" or "atom"'
122+
);
120123
$this->renderer->setFeedType('foobar');
121124
}
122125

0 commit comments

Comments
 (0)
This repository has been archived.