From 0ce9b570a6fba2b2b8cf2fa387e9783070bcd455 Mon Sep 17 00:00:00 2001 From: "S. Simeonov" Date: Sun, 6 Jan 2019 00:48:28 +0200 Subject: [PATCH] Migrate to php 7 --- composer.json | 7 +++---- tests/Roku/Commands/CommandTest.php | 3 ++- tests/Roku/Commands/SensorTest.php | 3 ++- tests/Roku/RokuTest.php | 23 ++++++++++++----------- 4 files changed, 19 insertions(+), 17 deletions(-) diff --git a/composer.json b/composer.json index f8042c2..d5d5bae 100644 --- a/composer.json +++ b/composer.json @@ -16,14 +16,13 @@ "issues": "https://github.com/svilborg/php-roku?state=open", "source": "https://github.com/svilborg/php-roku" }, - "minimum-stability": "dev", "require":{ - "php":">=5.3.2", + "php":">=7.0.0", "nategood/httpful": "*" }, "require-dev":{ - "phpunit/phpunit":"3.7.*@dev", - "satooshi/php-coveralls": "dev-master" + "phpunit/phpunit": "^4.8.35 || ^5.4.3 || ^6.0", + "satooshi/php-coveralls": "2.*" }, "autoload":{ "psr-0":{ diff --git a/tests/Roku/Commands/CommandTest.php b/tests/Roku/Commands/CommandTest.php index aec9dee..df6f55c 100644 --- a/tests/Roku/Commands/CommandTest.php +++ b/tests/Roku/Commands/CommandTest.php @@ -2,8 +2,9 @@ namespace Tests\Roku; use \Roku\Commands\Command; +use PHPUnit\Framework\TestCase; -class CommandTest extends \PHPUnit_Framework_TestCase +class CommandTest extends TestCase { public function setUp() diff --git a/tests/Roku/Commands/SensorTest.php b/tests/Roku/Commands/SensorTest.php index 48387d8..b421e7f 100644 --- a/tests/Roku/Commands/SensorTest.php +++ b/tests/Roku/Commands/SensorTest.php @@ -2,8 +2,9 @@ namespace Tests\Roku; use \Roku\Commands\Sensor; +use PHPUnit\Framework\TestCase; -class SensorTest extends \PHPUnit_Framework_TestCase +class SensorTest extends TestCase { public function setUp() diff --git a/tests/Roku/RokuTest.php b/tests/Roku/RokuTest.php index 3019bf3..a899968 100644 --- a/tests/Roku/RokuTest.php +++ b/tests/Roku/RokuTest.php @@ -3,8 +3,9 @@ use Roku; use \Httpful\Request; +use PHPUnit\Framework\TestCase; -class RokuTest extends \PHPUnit_Framework_TestCase +class RokuTest extends TestCase { public function setUp() { @@ -69,21 +70,21 @@ public function testApplication() $this->assertEquals(new \Roku\Application("dev", "0.1.0", "Test App"), $app); } + /** + * @expectedException \Roku\Exception + * @expectedExceptionCode 0 + */ public function testErrors() { - $this->setExpectedException( - '\Roku\Exception' - ); - $this->assertNotNull($this->roku->rotate()); } + /** + * @expectedException \Roku\Exception + * @expectedExceptionCode 0 + */ public function testErrorsTouch() { - $this->setExpectedException( - '\Roku\Exception' - ); - $this->assertNotNull($this->roku->touch(1,1,"nosuchtouch")); } @@ -134,7 +135,7 @@ public function getHttpInstance () { $response = new \Httpful\Response("", $headers, \Httpful\Request::init()); - $http = $this->getMock('\Roku\Utils\Http'); + $http = $this->createMock('\Roku\Utils\Http'); // Configure the stub. $http->expects($this->any()) @@ -156,7 +157,7 @@ public function getHttpXmlInstance ($file = "apps.xml") { $response = new \Httpful\Response( file_get_contents(__DIR__."/../data/" . $file), $headers, \Httpful\Request::init()); - $http = $this->getMock('\Roku\Utils\Http'); + $http = $this->createMock('\Roku\Utils\Http'); // Configure the stub. $http->expects($this->any())