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

Commit 84e3bf4

Browse files
committed
Merge branch 'feature/116' into develop
Close #116
2 parents f636319 + ac3a6e6 commit 84e3bf4

36 files changed

+134
-105
lines changed

test/Helper/AbstractHtmlElementTest.php

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,7 @@
1010
namespace ZendTest\View\Helper;
1111

1212
use PHPUnit\Framework\TestCase;
13+
use Zend\View\Helper\AbstractHtmlElement;
1314
use Zend\View\Renderer\PhpRenderer;
1415

1516
/**
@@ -20,7 +21,7 @@
2021
class AbstractHtmlElementTest extends TestCase
2122
{
2223
/**
23-
* @var \Zend\View\Helper\AbstractHtmlElement|\PHPUnit_Framework_MockObject_MockObject
24+
* @var AbstractHtmlElement|\PHPUnit_Framework_MockObject_MockObject
2425
*/
2526
protected $helper;
2627

@@ -29,7 +30,7 @@ class AbstractHtmlElementTest extends TestCase
2930
*/
3031
public function setUp()
3132
{
32-
$this->helper = $this->getMockForAbstractClass('Zend\View\Helper\AbstractHtmlElement');
33+
$this->helper = $this->getMockForAbstractClass(AbstractHtmlElement::class);
3334

3435
$this->helper->setView(new PhpRenderer());
3536
}

test/Helper/AbstractTest.php

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,7 @@
1010
namespace ZendTest\View\Helper;
1111

1212
use PHPUnit\Framework\TestCase;
13+
use Zend\View\Renderer\RendererInterface;
1314
use ZendTest\View\Helper\TestAsset\ConcreteHelper;
1415

1516
/**
@@ -30,7 +31,7 @@ public function setUp()
3031

3132
public function testViewSettersGetters()
3233
{
33-
$viewMock = $this->getMockBuilder('Zend\View\Renderer\RendererInterface')->getMock();
34+
$viewMock = $this->getMockBuilder(RendererInterface::class)->getMock();
3435

3536
$this->helper->setView($viewMock);
3637
$this->assertEquals($viewMock, $this->helper->getView());

test/Helper/CycleTest.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -50,7 +50,7 @@ public function tearDown()
5050
public function testCycleMethodReturnsObjectInstance()
5151
{
5252
$cycle = $this->helper->__invoke();
53-
$this->assertInstanceOf('Zend\View\Helper\Cycle', $cycle);
53+
$this->assertInstanceOf(Helper\Cycle::class, $cycle);
5454
}
5555

5656
public function testAssignAndGetValues()

test/Helper/DoctypeTest.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -56,7 +56,7 @@ public function tearDown()
5656
public function testDoctypeMethodReturnsObjectInstance()
5757
{
5858
$doctype = $this->helper->__invoke();
59-
$this->assertInstanceOf('Zend\View\Helper\Doctype', $doctype);
59+
$this->assertInstanceOf(Helper\Doctype::class, $doctype);
6060
}
6161

6262
public function testPassingDoctypeSetsDoctype()

test/Helper/EscapeCssTest.php

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,7 @@
1111

1212
use PHPUnit\Framework\TestCase;
1313
use stdClass;
14+
use Zend\Escaper\Escaper;
1415
use Zend\View\Helper\EscapeCss as EscapeHelper;
1516

1617
class EscapeCssTest extends TestCase
@@ -51,22 +52,22 @@ public function testGetEscaperCreatesDefaultInstanceWithCorrectEncoding()
5152
{
5253
$this->helper->setEncoding('BIG5-HKSCS');
5354
$escaper = $this->helper->getEscaper();
54-
$this->assertInstanceOf('Zend\Escaper\Escaper', $escaper);
55+
$this->assertInstanceOf(Escaper::class, $escaper);
5556
$this->assertEquals('big5-hkscs', $escaper->getEncoding());
5657
}
5758

5859
public function testSettingEscaperObjectAlsoSetsEncoding()
5960
{
60-
$escaper = new \Zend\Escaper\Escaper('big5-hkscs');
61+
$escaper = new Escaper('big5-hkscs');
6162
$this->helper->setEscaper($escaper);
6263
$escaper = $this->helper->getEscaper();
63-
$this->assertInstanceOf('Zend\Escaper\Escaper', $escaper);
64+
$this->assertInstanceOf(Escaper::class, $escaper);
6465
$this->assertEquals('big5-hkscs', $escaper->getEncoding());
6566
}
6667

6768
public function testEscapehtmlCalledOnEscaperObject()
6869
{
69-
$escaper = $this->getMockBuilder('\\Zend\\Escaper\\Escaper')->getMock();
70+
$escaper = $this->getMockBuilder(Escaper::class)->getMock();
7071
$escaper->expects($this->any())->method('escapeCss');
7172
$this->helper->setEscaper($escaper);
7273
$this->helper->__invoke('foo');

test/Helper/EscapeHtmlAttrTest.php

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,7 @@
1111

1212
use PHPUnit\Framework\TestCase;
1313
use stdClass;
14+
use Zend\Escaper\Escaper;
1415
use Zend\View\Helper\EscapeHtmlAttr as EscapeHelper;
1516

1617
class EscapeHtmlAttrTest extends TestCase
@@ -51,22 +52,22 @@ public function testGetEscaperCreatesDefaultInstanceWithCorrectEncoding()
5152
{
5253
$this->helper->setEncoding('BIG5-HKSCS');
5354
$escaper = $this->helper->getEscaper();
54-
$this->assertInstanceOf('Zend\Escaper\Escaper', $escaper);
55+
$this->assertInstanceOf(Escaper::class, $escaper);
5556
$this->assertEquals('big5-hkscs', $escaper->getEncoding());
5657
}
5758

5859
public function testSettingEscaperObjectAlsoSetsEncoding()
5960
{
60-
$escaper = new \Zend\Escaper\Escaper('big5-hkscs');
61+
$escaper = new Escaper('big5-hkscs');
6162
$this->helper->setEscaper($escaper);
6263
$escaper = $this->helper->getEscaper();
63-
$this->assertInstanceOf('Zend\Escaper\Escaper', $escaper);
64+
$this->assertInstanceOf(Escaper::class, $escaper);
6465
$this->assertEquals('big5-hkscs', $escaper->getEncoding());
6566
}
6667

6768
public function testEscapehtmlCalledOnEscaperObject()
6869
{
69-
$escaper = $this->getMockBuilder('\\Zend\\Escaper\\Escaper')->getMock();
70+
$escaper = $this->getMockBuilder(Escaper::class)->getMock();
7071
$escaper->expects($this->any())->method('escapeHtmlAttr');
7172
$this->helper->setEscaper($escaper);
7273
$this->helper->__invoke('foo');

test/Helper/EscapeHtmlTest.php

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,7 @@
1111

1212
use PHPUnit\Framework\TestCase;
1313
use stdClass;
14+
use Zend\Escaper\Escaper;
1415
use Zend\View\Helper\EscapeHtml as EscapeHelper;
1516

1617
class EscapeHtmlTest extends TestCase
@@ -51,22 +52,22 @@ public function testGetEscaperCreatesDefaultInstanceWithCorrectEncoding()
5152
{
5253
$this->helper->setEncoding('BIG5-HKSCS');
5354
$escaper = $this->helper->getEscaper();
54-
$this->assertInstanceOf('Zend\Escaper\Escaper', $escaper);
55+
$this->assertInstanceOf(Escaper::class, $escaper);
5556
$this->assertEquals('big5-hkscs', $escaper->getEncoding());
5657
}
5758

5859
public function testSettingEscaperObjectAlsoSetsEncoding()
5960
{
60-
$escaper = new \Zend\Escaper\Escaper('big5-hkscs');
61+
$escaper = new Escaper('big5-hkscs');
6162
$this->helper->setEscaper($escaper);
6263
$escaper = $this->helper->getEscaper();
63-
$this->assertInstanceOf('Zend\Escaper\Escaper', $escaper);
64+
$this->assertInstanceOf(Escaper::class, $escaper);
6465
$this->assertEquals('big5-hkscs', $escaper->getEncoding());
6566
}
6667

6768
public function testEscapehtmlCalledOnEscaperObject()
6869
{
69-
$escaper = $this->getMockBuilder('\\Zend\\Escaper\\Escaper')->getMock();
70+
$escaper = $this->getMockBuilder(Escaper::class)->getMock();
7071
$escaper->expects($this->any())->method('escapeHtml');
7172
$this->helper->setEscaper($escaper);
7273
$this->helper->__invoke('foo');

test/Helper/EscapeJsTest.php

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,7 @@
1111

1212
use PHPUnit\Framework\TestCase;
1313
use stdClass;
14+
use Zend\Escaper\Escaper;
1415
use Zend\View\Helper\EscapeJs as EscapeHelper;
1516

1617
class EscapeJsTest extends TestCase
@@ -51,22 +52,22 @@ public function testGetEscaperCreatesDefaultInstanceWithCorrectEncoding()
5152
{
5253
$this->helper->setEncoding('BIG5-HKSCS');
5354
$escaper = $this->helper->getEscaper();
54-
$this->assertInstanceOf('Zend\Escaper\Escaper', $escaper);
55+
$this->assertInstanceOf(Escaper::class, $escaper);
5556
$this->assertEquals('big5-hkscs', $escaper->getEncoding());
5657
}
5758

5859
public function testSettingEscaperObjectAlsoSetsEncoding()
5960
{
60-
$escaper = new \Zend\Escaper\Escaper('big5-hkscs');
61+
$escaper = new Escaper('big5-hkscs');
6162
$this->helper->setEscaper($escaper);
6263
$escaper = $this->helper->getEscaper();
63-
$this->assertInstanceOf('Zend\Escaper\Escaper', $escaper);
64+
$this->assertInstanceOf(Escaper::class, $escaper);
6465
$this->assertEquals('big5-hkscs', $escaper->getEncoding());
6566
}
6667

6768
public function testEscapehtmlCalledOnEscaperObject()
6869
{
69-
$escaper = $this->getMockBuilder('\\Zend\\Escaper\\Escaper')->getMock();
70+
$escaper = $this->getMockBuilder(Escaper::class)->getMock();
7071
$escaper->expects($this->any())->method('escapeJs');
7172
$this->helper->setEscaper($escaper);
7273
$this->helper->__invoke('foo');

test/Helper/EscapeUrlTest.php

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,7 @@
1111

1212
use PHPUnit\Framework\TestCase;
1313
use stdClass;
14+
use Zend\Escaper\Escaper;
1415
use Zend\View\Helper\EscapeUrl as EscapeHelper;
1516

1617
class EscapeUrlTest extends TestCase
@@ -51,22 +52,22 @@ public function testGetEscaperCreatesDefaultInstanceWithCorrectEncoding()
5152
{
5253
$this->helper->setEncoding('BIG5-HKSCS');
5354
$escaper = $this->helper->getEscaper();
54-
$this->assertInstanceOf('Zend\Escaper\Escaper', $escaper);
55+
$this->assertInstanceOf(Escaper::class, $escaper);
5556
$this->assertEquals('big5-hkscs', $escaper->getEncoding());
5657
}
5758

5859
public function testSettingEscaperObjectAlsoSetsEncoding()
5960
{
60-
$escaper = new \Zend\Escaper\Escaper('big5-hkscs');
61+
$escaper = new Escaper('big5-hkscs');
6162
$this->helper->setEscaper($escaper);
6263
$escaper = $this->helper->getEscaper();
63-
$this->assertInstanceOf('Zend\Escaper\Escaper', $escaper);
64+
$this->assertInstanceOf(Escaper::class, $escaper);
6465
$this->assertEquals('big5-hkscs', $escaper->getEncoding());
6566
}
6667

6768
public function testEscapehtmlCalledOnEscaperObject()
6869
{
69-
$escaper = $this->getMockBuilder('\\Zend\\Escaper\\Escaper')->getMock();
70+
$escaper = $this->getMockBuilder(Escaper::class)->getMock();
7071
$escaper->expects($this->any())->method('escapeUrl');
7172
$this->helper->setEscaper($escaper);
7273
$this->helper->__invoke('foo');

test/Helper/FlashMessengerTest.php

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,7 @@
1010
namespace ZendTest\View\Helper;
1111

1212
use PHPUnit\Framework\TestCase;
13+
use Zend\I18n\Translator\Translator;
1314
use Zend\Mvc\Controller\Plugin\FlashMessenger as V2PluginFlashMessenger;
1415
use Zend\Mvc\Controller\PluginManager;
1516
use Zend\Mvc\Plugin\FlashMessenger\FlashMessenger as V3PluginFlashMessenger;
@@ -397,7 +398,7 @@ public function testCanDisplayListOfCurrentMessagesCustomisedByConfigSeparator()
397398

398399
public function testCanTranslateMessages()
399400
{
400-
$mockTranslator = $this->getMockBuilder('Zend\I18n\Translator\Translator')->getMock();
401+
$mockTranslator = $this->getMockBuilder(Translator::class)->getMock();
401402
$mockTranslator->expects($this->exactly(1))
402403
->method('translate')
403404
->will($this->returnValue('translated message'));
@@ -414,7 +415,7 @@ public function testCanTranslateMessages()
414415

415416
public function testCanTranslateCurrentMessages()
416417
{
417-
$mockTranslator = $this->getMockBuilder('Zend\I18n\Translator\Translator')->getMock();
418+
$mockTranslator = $this->getMockBuilder(Translator::class)->getMock();
418419
$mockTranslator->expects($this->exactly(1))
419420
->method('translate')
420421
->will($this->returnValue('translated message'));

0 commit comments

Comments
 (0)