diff options
author | Daniel Opitz <git@copynpaste.de> | 2018-10-16 22:37:48 +0200 |
---|---|---|
committer | Sean Molenaar <SMillerDev@users.noreply.github.com> | 2018-12-04 17:10:46 +0100 |
commit | e158cc1d3b1fb33de5aaa1aaac0c7828016fb7b9 (patch) | |
tree | 4d3b4da643a428f259ca9fe1c63d97f8cecfb5fc /tests/Unit/Fetcher/FetcherTest.php | |
parent | 5c7fdb08534018ba86ec4a38f45b63cbbf67a72f (diff) |
use magic class constant instead of classname strings
Diffstat (limited to 'tests/Unit/Fetcher/FetcherTest.php')
-rw-r--r-- | tests/Unit/Fetcher/FetcherTest.php | 15 |
1 files changed, 8 insertions, 7 deletions
diff --git a/tests/Unit/Fetcher/FetcherTest.php b/tests/Unit/Fetcher/FetcherTest.php index 5ff800b21..e8c648177 100644 --- a/tests/Unit/Fetcher/FetcherTest.php +++ b/tests/Unit/Fetcher/FetcherTest.php @@ -26,6 +26,7 @@ namespace OCA\News\Tests\Unit\Fetcher; use OCA\News\Fetcher\Fetcher; +use OCA\News\Fetcher\IFeedFetcher; use PHPUnit\Framework\TestCase; class FetcherTest extends TestCase @@ -42,7 +43,7 @@ class FetcherTest extends TestCase public function testFetch() { $url = 'hi'; - $mockFetcher = $this->getMockBuilder('\OCA\News\Fetcher\IFeedFetcher') + $mockFetcher = $this->getMockBuilder(IFeedFetcher::class) ->disableOriginalConstructor() ->getMock(); $mockFetcher->expects($this->once()) @@ -67,14 +68,14 @@ class FetcherTest extends TestCase public function testNoFetchers() { $url = 'hi'; - $mockFetcher = $this->getMockBuilder('\OCA\News\Fetcher\IFeedFetcher') + $mockFetcher = $this->getMockBuilder(IFeedFetcher::class) ->disableOriginalConstructor() ->getMock(); $mockFetcher->expects($this->once()) ->method('canHandle') ->with($this->equalTo($url)) ->will($this->returnValue(false)); - $mockFetcher2 = $this->getMockBuilder('\OCA\News\Fetcher\IFeedFetcher') + $mockFetcher2 = $this->getMockBuilder(IFeedFetcher::class) ->disableOriginalConstructor() ->getMock(); $mockFetcher2->expects($this->once()) @@ -92,14 +93,14 @@ class FetcherTest extends TestCase public function testMultipleFetchers() { $url = 'hi'; - $mockFetcher = $this->getMockBuilder('\OCA\News\Fetcher\IFeedFetcher') + $mockFetcher = $this->getMockBuilder(IFeedFetcher::class) ->disableOriginalConstructor() ->getMock(); $mockFetcher->expects($this->once()) ->method('canHandle') ->with($this->equalTo($url)) ->will($this->returnValue(false)); - $mockFetcher2 = $this->getMockBuilder('\OCA\News\Fetcher\IFeedFetcher') + $mockFetcher2 = $this->getMockBuilder(IFeedFetcher::class) ->disableOriginalConstructor() ->getMock(); $mockFetcher2->expects($this->once()) @@ -118,7 +119,7 @@ class FetcherTest extends TestCase { $url = 'hi'; $return = 'zeas'; - $mockFetcher = $this->getMockBuilder('\OCA\News\Fetcher\IFeedFetcher') + $mockFetcher = $this->getMockBuilder(IFeedFetcher::class) ->disableOriginalConstructor() ->getMock(); $mockFetcher->expects($this->once()) @@ -129,7 +130,7 @@ class FetcherTest extends TestCase ->method('fetch') ->with($this->equalTo($url)) ->will($this->returnValue($return)); - $mockFetcher2 = $this->getMockBuilder('\OCA\News\Fetcher\IFeedFetcher') + $mockFetcher2 = $this->getMockBuilder(IFeedFetcher::class) ->disableOriginalConstructor() ->getMock(); $mockFetcher2->expects($this->never()) |