Skip to content

Commit ddce0d8

Browse files
Merge pull request #7 from thewilkybarkid/modernise-constraints
Modernise constraints
2 parents 343131d + 4087eac commit ddce0d8

File tree

4 files changed

+21
-18
lines changed

4 files changed

+21
-18
lines changed

Tests/AbstractTestCase.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@ class AbstractTestCase extends PHPUnit_Framework_TestCase
2323
protected function getContainer(array $config = array(), KernelInterface $kernel = null)
2424
{
2525
if (null === $kernel) {
26-
$kernel = $this->getMock('Symfony\Component\HttpKernel\KernelInterface');
26+
$kernel = $this->getMockBuilder('Symfony\Component\HttpKernel\KernelInterface')->getMock();
2727
$kernel
2828
->expects($this->any())
2929
->method('getBundles')

Tests/Helper/LinkifyHelperTest.php

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ class LinkifyHelperTest extends AbstractTestCase
1818
{
1919
public function testConstructor()
2020
{
21-
$linkify = $this->getMock('Misd\Linkify\Linkify');
21+
$linkify = $this->getMockBuilder('Misd\Linkify\Linkify')->getMock();
2222

2323
$helper = new LinkifyHelper($linkify);
2424

@@ -28,7 +28,7 @@ public function testConstructor()
2828

2929
public function testCharset()
3030
{
31-
$linkify = $this->getMock('Misd\Linkify\Linkify');
31+
$linkify = $this->getMockBuilder('Misd\Linkify\Linkify')->getMock();
3232

3333
$helper = new LinkifyHelper($linkify);
3434

@@ -39,7 +39,7 @@ public function testCharset()
3939

4040
public function testName()
4141
{
42-
$linkify = $this->getMock('Misd\Linkify\Linkify');
42+
$linkify = $this->getMockBuilder('Misd\Linkify\Linkify')->getMock();
4343

4444
$helper = new LinkifyHelper($linkify);
4545

@@ -51,7 +51,7 @@ public function testProcess()
5151
$text = 'test';
5252
$options = array('key' => 'value');
5353

54-
$linkify = $this->getMock('Misd\Linkify\Linkify');
54+
$linkify = $this->getMockBuilder('Misd\Linkify\Linkify')->getMock();
5555
$linkify->expects($this->once())->method('process')->with($text, $options);
5656

5757
$helper = new LinkifyHelper($linkify);

Tests/Twig/Extension/LinkifyTwigExtensionTest.php

Lines changed: 11 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -18,8 +18,8 @@ class LinkifyTwigExtensionTest extends AbstractTestCase
1818
{
1919
public function testConstructor()
2020
{
21-
$linkify = $this->getMock('Misd\Linkify\Linkify');
22-
$helper = $this->getMock('Misd\LinkifyBundle\Helper\LinkifyHelper', array(), array($linkify));
21+
$linkify = $this->getMockBuilder('Misd\Linkify\Linkify')->getMock();
22+
$helper = $this->getMockBuilder('Misd\LinkifyBundle\Helper\LinkifyHelper')->setConstructorArgs(array($linkify))->getMock();
2323

2424
$extension = new LinkifyTwigExtension($helper);
2525

@@ -29,8 +29,8 @@ public function testConstructor()
2929

3030
public function testFilters()
3131
{
32-
$linkify = $this->getMock('Misd\Linkify\Linkify');
33-
$helper = $this->getMock('Misd\LinkifyBundle\Helper\LinkifyHelper', array(), array($linkify));
32+
$linkify = $this->getMockBuilder('Misd\Linkify\Linkify')->getMock();
33+
$helper = $this->getMockBuilder('Misd\LinkifyBundle\Helper\LinkifyHelper')->setConstructorArgs(array($linkify))->getMock();
3434

3535
$extension = new LinkifyTwigExtension($helper);
3636

@@ -45,8 +45,11 @@ public function testLinkify()
4545
$text = 'test';
4646
$options = array('key' => 'value');
4747

48-
$linkify = $this->getMock('Misd\Linkify\Linkify');
49-
$helper = $this->getMock('Misd\LinkifyBundle\Helper\LinkifyHelper', array('process'), array($linkify));
48+
$linkify = $this->getMockBuilder('Misd\Linkify\Linkify')->getMock();
49+
$helper = $this->getMockBuilder('Misd\LinkifyBundle\Helper\LinkifyHelper')
50+
->setMethods(array('process'))
51+
->setConstructorArgs(array($linkify))
52+
->getMock();
5053
$helper->expects($this->once())->method('process')->with($text, $options);
5154

5255
$extension = new LinkifyTwigExtension($helper);
@@ -56,8 +59,8 @@ public function testLinkify()
5659

5760
public function testName()
5861
{
59-
$linkify = $this->getMock('Misd\Linkify\Linkify');
60-
$helper = $this->getMock('Misd\LinkifyBundle\Helper\LinkifyHelper', array(), array($linkify));
62+
$linkify = $this->getMockBuilder('Misd\Linkify\Linkify')->getMock();
63+
$helper = $this->getMockBuilder('Misd\LinkifyBundle\Helper\LinkifyHelper')->setConstructorArgs(array($linkify))->getMock();
6164

6265
$extension = new LinkifyTwigExtension($helper);
6366

composer.json

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -15,13 +15,13 @@
1515
"issues": "https://github.com/misd-service-development/linkify-bundle/issues"
1616
},
1717
"require": {
18-
"php": ">=5.3.3",
19-
"symfony/framework-bundle": "~2.1",
20-
"misd/linkify": "~1.0"
18+
"php": "^5.3.3 || ^7.0",
19+
"symfony/framework-bundle": "^2.1",
20+
"misd/linkify": "^1.0"
2121
},
2222
"require-dev": {
23-
"phpunit/phpunit": "~4.0",
24-
"symfony/twig-bundle": "~2.1"
23+
"phpunit/phpunit": "^4.0 || ^5.0",
24+
"symfony/twig-bundle": "^2.1"
2525
},
2626
"conflict": {
2727
"phpunit/phpunit-mock-objects": "<2.2"

0 commit comments

Comments
 (0)