diff options
Diffstat (limited to 'tests/Unit/Service')
-rw-r--r-- | tests/Unit/Service/FeedServiceTest.php | 14 | ||||
-rw-r--r-- | tests/Unit/Service/FolderServiceTest.php | 10 | ||||
-rw-r--r-- | tests/Unit/Service/ItemServiceTest.php | 10 | ||||
-rw-r--r-- | tests/Unit/Service/ServiceTest.php | 7 | ||||
-rw-r--r-- | tests/Unit/Service/StatusServiceTest.php | 3 |
5 files changed, 26 insertions, 18 deletions
diff --git a/tests/Unit/Service/FeedServiceTest.php b/tests/Unit/Service/FeedServiceTest.php index d5c5e0bfa..c7b06040a 100644 --- a/tests/Unit/Service/FeedServiceTest.php +++ b/tests/Unit/Service/FeedServiceTest.php @@ -22,8 +22,10 @@ use OCA\News\Db\Item; use OCA\News\Fetcher\Fetcher; use OCA\News\Fetcher\FetcherException; +use PHPUnit\Framework\TestCase; -class FeedServiceTest extends \PHPUnit_Framework_TestCase + +class FeedServiceTest extends TestCase { private $feedMapper; @@ -114,7 +116,7 @@ class FeedServiceTest extends \PHPUnit_Framework_TestCase ->method('fetch') ->with($this->equalTo($url)) ->will($this->throwException($ex)); - $this->setExpectedException( + $this->expectException( '\OCA\News\Service\ServiceNotFoundException' ); $this->feedService->create($url, 1, $this->user); @@ -606,7 +608,7 @@ class FeedServiceTest extends \PHPUnit_Framework_TestCase ) ->will($this->throwException($ex)); - $this->setExpectedException( + $this->expectException( '\OCA\News\Service\ServiceNotFoundException' ); $this->feedService->update($feed->getId(), $this->user); @@ -643,7 +645,7 @@ class FeedServiceTest extends \PHPUnit_Framework_TestCase ) ->will($this->throwException($ex)); - $this->setExpectedException( + $this->expectException( 'OCP\AppFramework\Db\DoesNotExistException' ); $this->feedService->update($feed->getId(), $this->user); @@ -698,7 +700,7 @@ class FeedServiceTest extends \PHPUnit_Framework_TestCase ) ->will($this->throwException($ex)); - $this->setExpectedException( + $this->expectException( '\OCA\News\Service\ServiceNotFoundException' ); $this->feedService->update($feed->getId(), $this->user); @@ -1100,7 +1102,7 @@ class FeedServiceTest extends \PHPUnit_Framework_TestCase ) ->will($this->throwException(new DoesNotExistException(''))); - $this->setExpectedException( + $this->expectException( '\OCA\News\Service\ServiceNotFoundException' ); diff --git a/tests/Unit/Service/FolderServiceTest.php b/tests/Unit/Service/FolderServiceTest.php index 10ba91a87..88d594835 100644 --- a/tests/Unit/Service/FolderServiceTest.php +++ b/tests/Unit/Service/FolderServiceTest.php @@ -16,8 +16,10 @@ namespace OCA\News\Tests\Unit\Service; use \OCA\News\Db\Folder; use OCA\News\Service\FolderService; +use PHPUnit\Framework\TestCase; -class FolderServiceTest extends \PHPUnit_Framework_TestCase + +class FolderServiceTest extends TestCase { private $folderMapper; @@ -111,7 +113,7 @@ class FolderServiceTest extends \PHPUnit_Framework_TestCase ->with($this->equalTo($folderName)) ->will($this->returnValue($rows)); - $this->setExpectedException( + $this->expectException( '\OCA\News\Service\ServiceConflictException' ); $this->folderService->create($folderName, 'john', 3); @@ -190,7 +192,7 @@ class FolderServiceTest extends \PHPUnit_Framework_TestCase ->with($this->equalTo($folderName)) ->will($this->returnValue($rows)); - $this->setExpectedException( + $this->expectException( '\OCA\News\Service\ServiceConflictException' ); $this->folderService->rename(3, $folderName, 'john'); @@ -206,7 +208,7 @@ class FolderServiceTest extends \PHPUnit_Framework_TestCase ->with($this->equalTo($folderName)) ->will($this->returnValue([])); - $this->setExpectedException( + $this->expectException( '\OCA\News\Service\ServiceValidationException' ); $this->folderService->rename(3, $folderName, 'john'); diff --git a/tests/Unit/Service/ItemServiceTest.php b/tests/Unit/Service/ItemServiceTest.php index 0f79cfd04..0ef5ce366 100644 --- a/tests/Unit/Service/ItemServiceTest.php +++ b/tests/Unit/Service/ItemServiceTest.php @@ -19,8 +19,10 @@ use \OCP\AppFramework\Db\DoesNotExistException; use \OCA\News\Db\Item; use \OCA\News\Db\FeedType; +use PHPUnit\Framework\TestCase; -class ItemServiceTest extends \PHPUnit_Framework_TestCase + +class ItemServiceTest extends TestCase { private $mapper; @@ -337,7 +339,7 @@ class ItemServiceTest extends \PHPUnit_Framework_TestCase public function testReadDoesNotExist() { - $this->setExpectedException( + $this->expectException( '\OCA\News\Service\ServiceNotFoundException' ); $this->mapper->expects($this->once()) @@ -350,7 +352,7 @@ class ItemServiceTest extends \PHPUnit_Framework_TestCase public function testStarDoesNotExist() { - $this->setExpectedException( + $this->expectException( '\OCA\News\Service\ServiceNotFoundException' ); $this->mapper->expects($this->once()) @@ -460,7 +462,7 @@ class ItemServiceTest extends \PHPUnit_Framework_TestCase ) ); - $this->setExpectedException( + $this->expectException( '\OCA\News\Service\ServiceNotFoundException' ); $this->itemService->getNewestItemId($this->user); diff --git a/tests/Unit/Service/ServiceTest.php b/tests/Unit/Service/ServiceTest.php index 668d54903..39f81843c 100644 --- a/tests/Unit/Service/ServiceTest.php +++ b/tests/Unit/Service/ServiceTest.php @@ -18,6 +18,7 @@ use \OCP\AppFramework\Db\DoesNotExistException; use \OCP\AppFramework\Db\MultipleObjectsReturnedException; use \OCA\News\Db\Folder; +use PHPUnit\Framework\TestCase; class TestService extends Service @@ -28,7 +29,7 @@ class TestService extends Service } } -class ServiceTest extends \PHPUnit_Framework_TestCase +class ServiceTest extends TestCase { protected $mapper; @@ -83,7 +84,7 @@ class ServiceTest extends \PHPUnit_Framework_TestCase ->method('find') ->will($this->throwException($ex)); - $this->setExpectedException( + $this->expectException( '\OCA\News\Service\ServiceNotFoundException' ); $this->newsService->find(1, ''); @@ -98,7 +99,7 @@ class ServiceTest extends \PHPUnit_Framework_TestCase ->method('find') ->will($this->throwException($ex)); - $this->setExpectedException( + $this->expectException( '\OCA\News\Service\ServiceNotFoundException' ); $this->newsService->find(1, ''); diff --git a/tests/Unit/Service/StatusServiceTest.php b/tests/Unit/Service/StatusServiceTest.php index aa2cbde0e..56423a9c6 100644 --- a/tests/Unit/Service/StatusServiceTest.php +++ b/tests/Unit/Service/StatusServiceTest.php @@ -15,9 +15,10 @@ namespace OCA\News\Tests\Unit\Service; use \OCA\News\Db\FeedType; use OCA\News\Service\StatusService; +use PHPUnit\Framework\TestCase; -class StatusServiceTest extends \PHPUnit_Framework_TestCase +class StatusServiceTest extends TestCase { private $settings; |