From fa5f07ba9a77959796c3c7a4851f2f2fe1051afa Mon Sep 17 00:00:00 2001 From: Sean Molenaar Date: Mon, 1 Oct 2018 10:07:57 +0200 Subject: Put back old tests for stable nextcloud version --- tests/Integration/IntegrationTest.php | 2 +- tests/Unit/Config/ConfigTest.php | 5 ++--- tests/Unit/Controller/AdminControllerTest.php | 3 ++- tests/Unit/Controller/EntityApiSerializerTest.php | 4 ++-- tests/Unit/Controller/ExportControllerTest.php | 3 ++- tests/Unit/Controller/FeedApiControllerTest.php | 3 ++- tests/Unit/Controller/FeedControllerTest.php | 3 ++- tests/Unit/Controller/FolderApiControllerTest.php | 4 +++- tests/Unit/Controller/FolderControllerTest.php | 4 +++- tests/Unit/Controller/ItemApiControllerTest.php | 4 +++- tests/Unit/Controller/ItemControllerTest.php | 4 +++- tests/Unit/Controller/JSONHttpErrorTest.php | 4 +++- tests/Unit/Controller/PageControllerTest.php | 3 ++- tests/Unit/Controller/UserApiControllerTest.php | 4 +++- tests/Unit/Controller/UtilityApiControllerTest.php | 4 +++- tests/Unit/Db/FeedTest.php | 4 ++-- tests/Unit/Db/FolderMapperTest.php | 4 ++-- tests/Unit/Db/FolderTest.php | 3 ++- tests/Unit/Db/ItemTest.php | 4 +++- tests/Unit/Db/MapperFactoryTest.php | 4 ++-- tests/Unit/Db/MapperTestUtility.php | 3 ++- tests/Unit/Fetcher/FeedFetcherTest.php | 3 ++- tests/Unit/Fetcher/FetcherTest.php | 3 ++- tests/Unit/Fetcher/YoutubeFetcherTest.php | 3 ++- tests/Unit/Http/TextDownloadResponseTest.php | 3 ++- tests/Unit/Http/TextResponseTest.php | 4 ++-- tests/Unit/Service/FeedServiceTest.php | 14 ++++++++------ tests/Unit/Service/FolderServiceTest.php | 10 ++++++---- tests/Unit/Service/ItemServiceTest.php | 10 ++++++---- tests/Unit/Service/ServiceTest.php | 7 ++++--- tests/Unit/Service/StatusServiceTest.php | 3 ++- tests/Unit/Utility/OPMLExporterTest.php | 3 ++- tests/Unit/Utility/ProxyConfigParserTest.php | 3 ++- tests/Unit/Utility/UpdaterTest.php | 4 ++-- 34 files changed, 91 insertions(+), 55 deletions(-) (limited to 'tests') diff --git a/tests/Integration/IntegrationTest.php b/tests/Integration/IntegrationTest.php index 751cbe5fd..8dbdec802 100644 --- a/tests/Integration/IntegrationTest.php +++ b/tests/Integration/IntegrationTest.php @@ -12,7 +12,7 @@ namespace OCA\News\Tests\Integration; -use PHPUnit_Framework_TestCase; +use PHPUnit\Framework\TestCase; use OCA\News\Db\Feed; use OCA\News\Db\Item; diff --git a/tests/Unit/Config/ConfigTest.php b/tests/Unit/Config/ConfigTest.php index 42d3c6e62..36e800ba4 100644 --- a/tests/Unit/Config/ConfigTest.php +++ b/tests/Unit/Config/ConfigTest.php @@ -14,10 +14,9 @@ namespace OCA\News\Tests\Unit\Config; use OCA\News\Config\Config; -use PHPUnit_Framework_TestCase; +use PHPUnit\Framework\TestCase; - -class ConfigTest extends PHPUnit_Framework_TestCase +class ConfigTest extends TestCase { private $fileSystem; diff --git a/tests/Unit/Controller/AdminControllerTest.php b/tests/Unit/Controller/AdminControllerTest.php index a2b7f304a..486330193 100644 --- a/tests/Unit/Controller/AdminControllerTest.php +++ b/tests/Unit/Controller/AdminControllerTest.php @@ -14,8 +14,9 @@ namespace OCA\News\Tests\Unit\Controller; use OCA\News\Controller\AdminController; +use PHPUnit\Framework\TestCase; -class AdminControllerTest extends \PHPUnit_Framework_TestCase +class AdminControllerTest extends TestCase { private $appName; diff --git a/tests/Unit/Controller/EntityApiSerializerTest.php b/tests/Unit/Controller/EntityApiSerializerTest.php index 49b7e0b8d..15f11a8b0 100644 --- a/tests/Unit/Controller/EntityApiSerializerTest.php +++ b/tests/Unit/Controller/EntityApiSerializerTest.php @@ -18,14 +18,14 @@ use \OCP\AppFramework\Http\Response; use \OCP\AppFramework\Db\Entity; use \OCA\News\Db\Item; +use PHPUnit\Framework\TestCase; class TestEntity extends Entity { } - -class EntityApiSerializerTest extends \PHPUnit_Framework_TestCase +class EntityApiSerializerTest extends TestCase { diff --git a/tests/Unit/Controller/ExportControllerTest.php b/tests/Unit/Controller/ExportControllerTest.php index 592582b3a..7917eee24 100644 --- a/tests/Unit/Controller/ExportControllerTest.php +++ b/tests/Unit/Controller/ExportControllerTest.php @@ -21,8 +21,9 @@ use \OCA\News\Utility\OPMLExporter; use \OCA\News\Db\Item; use \OCA\News\Db\Feed; +use PHPUnit\Framework\TestCase; -class ExportControllerTest extends \PHPUnit_Framework_TestCase +class ExportControllerTest extends TestCase { private $appName; diff --git a/tests/Unit/Controller/FeedApiControllerTest.php b/tests/Unit/Controller/FeedApiControllerTest.php index 9217014d4..ef61d1969 100644 --- a/tests/Unit/Controller/FeedApiControllerTest.php +++ b/tests/Unit/Controller/FeedApiControllerTest.php @@ -24,8 +24,9 @@ use \OCA\News\Db\Folder; use \OCA\News\Db\Feed; use \OCA\News\Db\Item; +use PHPUnit\Framework\TestCase; -class FeedApiControllerTest extends \PHPUnit_Framework_TestCase +class FeedApiControllerTest extends TestCase { private $feedService; diff --git a/tests/Unit/Controller/FeedControllerTest.php b/tests/Unit/Controller/FeedControllerTest.php index 8bff9b2eb..7580920d3 100644 --- a/tests/Unit/Controller/FeedControllerTest.php +++ b/tests/Unit/Controller/FeedControllerTest.php @@ -21,8 +21,9 @@ use OCA\News\Db\FeedType; use OCA\News\Service\ServiceNotFoundException; use OCA\News\Service\ServiceConflictException; +use PHPUnit\Framework\TestCase; -class FeedControllerTest extends \PHPUnit_Framework_TestCase +class FeedControllerTest extends TestCase { private $appName; diff --git a/tests/Unit/Controller/FolderApiControllerTest.php b/tests/Unit/Controller/FolderApiControllerTest.php index 1a3816b7b..d8035d902 100644 --- a/tests/Unit/Controller/FolderApiControllerTest.php +++ b/tests/Unit/Controller/FolderApiControllerTest.php @@ -27,8 +27,10 @@ use \OCA\News\Db\Folder; use \OCA\News\Db\Feed; use \OCA\News\Db\Item; +use PHPUnit\Framework\TestCase; -class FolderApiControllerTest extends \PHPUnit_Framework_TestCase + +class FolderApiControllerTest extends TestCase { private $folderService; diff --git a/tests/Unit/Controller/FolderControllerTest.php b/tests/Unit/Controller/FolderControllerTest.php index ba69fcac7..98b96c5c3 100644 --- a/tests/Unit/Controller/FolderControllerTest.php +++ b/tests/Unit/Controller/FolderControllerTest.php @@ -22,8 +22,10 @@ use \OCA\News\Service\ServiceNotFoundException; use \OCA\News\Service\ServiceConflictException; use \OCA\News\Service\ServiceValidationException; +use PHPUnit\Framework\TestCase; -class FolderControllerTest extends \PHPUnit_Framework_TestCase + +class FolderControllerTest extends TestCase { private $appName; diff --git a/tests/Unit/Controller/ItemApiControllerTest.php b/tests/Unit/Controller/ItemApiControllerTest.php index ad2b323e7..916b85a36 100644 --- a/tests/Unit/Controller/ItemApiControllerTest.php +++ b/tests/Unit/Controller/ItemApiControllerTest.php @@ -21,8 +21,10 @@ use \OCP\AppFramework\Http; use \OCA\News\Service\ServiceNotFoundException; use \OCA\News\Db\Item; +use PHPUnit\Framework\TestCase; -class ItemApiControllerTest extends \PHPUnit_Framework_TestCase + +class ItemApiControllerTest extends TestCase { private $itemService; diff --git a/tests/Unit/Controller/ItemControllerTest.php b/tests/Unit/Controller/ItemControllerTest.php index d99b9be21..0093083f4 100644 --- a/tests/Unit/Controller/ItemControllerTest.php +++ b/tests/Unit/Controller/ItemControllerTest.php @@ -21,8 +21,10 @@ use \OCA\News\Db\Feed; use \OCA\News\Db\FeedType; use \OCA\News\Service\ServiceNotFoundException; +use PHPUnit\Framework\TestCase; -class ItemControllerTest extends \PHPUnit_Framework_TestCase + +class ItemControllerTest extends TestCase { private $appName; diff --git a/tests/Unit/Controller/JSONHttpErrorTest.php b/tests/Unit/Controller/JSONHttpErrorTest.php index a77566e04..bf043bf54 100644 --- a/tests/Unit/Controller/JSONHttpErrorTest.php +++ b/tests/Unit/Controller/JSONHttpErrorTest.php @@ -15,12 +15,14 @@ namespace OCA\News\Tests\Unit\Controller; use OCA\News\Controller\JSONHttpError; +use PHPUnit\Framework\TestCase; + class Test { use JSONHttpError; } -class JSONHttpErrorTest extends \PHPUnit_Framework_TestCase +class JSONHttpErrorTest extends TestCase { diff --git a/tests/Unit/Controller/PageControllerTest.php b/tests/Unit/Controller/PageControllerTest.php index b90c200d4..84671ea6d 100644 --- a/tests/Unit/Controller/PageControllerTest.php +++ b/tests/Unit/Controller/PageControllerTest.php @@ -15,9 +15,10 @@ namespace OCA\News\Tests\Unit\Controller; use OCA\News\Controller\PageController; use \OCA\News\Db\FeedType; +use PHPUnit\Framework\TestCase; -class PageControllerTest extends \PHPUnit_Framework_TestCase +class PageControllerTest extends TestCase { private $settings; diff --git a/tests/Unit/Controller/UserApiControllerTest.php b/tests/Unit/Controller/UserApiControllerTest.php index e2868ebe1..d562329f3 100644 --- a/tests/Unit/Controller/UserApiControllerTest.php +++ b/tests/Unit/Controller/UserApiControllerTest.php @@ -15,7 +15,9 @@ namespace OCA\News\Tests\Unit\Controller; use OCA\News\Controller\UserApiController; -class UserApiControllerTest extends \PHPUnit_Framework_TestCase +use PHPUnit\Framework\TestCase; + +class UserApiControllerTest extends TestCase { private $request; diff --git a/tests/Unit/Controller/UtilityApiControllerTest.php b/tests/Unit/Controller/UtilityApiControllerTest.php index 172932b0e..8ae25a43d 100644 --- a/tests/Unit/Controller/UtilityApiControllerTest.php +++ b/tests/Unit/Controller/UtilityApiControllerTest.php @@ -17,7 +17,9 @@ namespace OCA\News\Tests\Unit\Controller; use OCA\News\Controller\UtilityApiController; -class UtilityApiControllerTest extends \PHPUnit_Framework_TestCase +use PHPUnit\Framework\TestCase; + +class UtilityApiControllerTest extends TestCase { private $settings; diff --git a/tests/Unit/Db/FeedTest.php b/tests/Unit/Db/FeedTest.php index 5e4e2a5a5..961e1d9b7 100644 --- a/tests/Unit/Db/FeedTest.php +++ b/tests/Unit/Db/FeedTest.php @@ -13,10 +13,10 @@ namespace OCA\News\Tests\Unit\Db; - +use PHPUnit\Framework\TestCase; use OCA\News\Db\Feed; -class FeedTest extends \PHPUnit_Framework_TestCase +class FeedTest extends TestCase { diff --git a/tests/Unit/Db/FolderMapperTest.php b/tests/Unit/Db/FolderMapperTest.php index bf7b1cae0..c8230ff0f 100644 --- a/tests/Unit/Db/FolderMapperTest.php +++ b/tests/Unit/Db/FolderMapperTest.php @@ -70,7 +70,7 @@ class FolderMapperTest extends MapperTestUtility $this->setMapperResult($sql, [$id, $userId]); - $this->setExpectedException( + $this->expectException( '\OCP\AppFramework\Db\DoesNotExistException' ); $this->folderMapper->find($id, $userId); @@ -88,7 +88,7 @@ class FolderMapperTest extends MapperTestUtility $this->setMapperResult($sql, [$id, $userId], $rows); - $this->setExpectedException( + $this->expectException( '\OCP\AppFramework\Db\MultipleObjectsReturnedException' ); $this->folderMapper->find($id, $userId); diff --git a/tests/Unit/Db/FolderTest.php b/tests/Unit/Db/FolderTest.php index 4db59cef2..a3445ea2e 100644 --- a/tests/Unit/Db/FolderTest.php +++ b/tests/Unit/Db/FolderTest.php @@ -14,8 +14,9 @@ namespace OCA\News\Tests\Unit\Db; use OCA\News\Db\Folder; +use PHPUnit\Framework\TestCase; -class FolderTest extends \PHPUnit_Framework_TestCase +class FolderTest extends TestCase { diff --git a/tests/Unit/Db/ItemTest.php b/tests/Unit/Db/ItemTest.php index f86c2c8a9..4c725b827 100644 --- a/tests/Unit/Db/ItemTest.php +++ b/tests/Unit/Db/ItemTest.php @@ -16,7 +16,9 @@ namespace OCA\News\Tests\Unit\Db; use OCA\News\Db\Feed; use OCA\News\Db\Item; -class ItemTest extends \PHPUnit_Framework_TestCase +use PHPUnit\Framework\TestCase; + +class ItemTest extends TestCase { /** diff --git a/tests/Unit/Db/MapperFactoryTest.php b/tests/Unit/Db/MapperFactoryTest.php index 94a49f850..697a62bee 100644 --- a/tests/Unit/Db/MapperFactoryTest.php +++ b/tests/Unit/Db/MapperFactoryTest.php @@ -16,14 +16,14 @@ namespace OCA\News\Tests\Unit\Db; use OCA\News\Db\ItemMapper; use OCA\News\Db\MapperFactory; use OCA\News\Utility\Time; -use PHPUnit_Framework_TestCase; +use PHPUnit\Framework\TestCase; use OCP\IDBConnection; use OCA\News\Db\Mysql\ItemMapper as MysqlMapper; -class MapperFactoryTest extends PHPUnit_Framework_TestCase +class MapperFactoryTest extends TestCase { private $db; diff --git a/tests/Unit/Db/MapperTestUtility.php b/tests/Unit/Db/MapperTestUtility.php index caef6527c..0c45a0bba 100644 --- a/tests/Unit/Db/MapperTestUtility.php +++ b/tests/Unit/Db/MapperTestUtility.php @@ -23,10 +23,11 @@ namespace OCA\News\Tests\Unit\Db; +use PHPUnit\Framework\TestCase; /** * Simple utility class for testing mappers */ -abstract class MapperTestUtility extends \PHPUnit_Framework_TestCase +abstract class MapperTestUtility extends TestCase { protected $db; private $query; diff --git a/tests/Unit/Fetcher/FeedFetcherTest.php b/tests/Unit/Fetcher/FeedFetcherTest.php index 500463e01..50fd4d6d6 100644 --- a/tests/Unit/Fetcher/FeedFetcherTest.php +++ b/tests/Unit/Fetcher/FeedFetcherTest.php @@ -18,9 +18,10 @@ use \OCA\News\Db\Feed; use OCA\News\Fetcher\FeedFetcher; use OCP\Http\Client\IClientService; use PicoFeed\Processor\ItemPostProcessor; +use PHPUnit\Framework\TestCase; -class FeedFetcherTest extends \PHPUnit_Framework_TestCase +class FeedFetcherTest extends TestCase { private $fetcher; diff --git a/tests/Unit/Fetcher/FetcherTest.php b/tests/Unit/Fetcher/FetcherTest.php index 971e35890..5ff800b21 100644 --- a/tests/Unit/Fetcher/FetcherTest.php +++ b/tests/Unit/Fetcher/FetcherTest.php @@ -26,8 +26,9 @@ namespace OCA\News\Tests\Unit\Fetcher; use OCA\News\Fetcher\Fetcher; +use PHPUnit\Framework\TestCase; -class FetcherTest extends \PHPUnit_Framework_TestCase +class FetcherTest extends TestCase { private $fetcher; diff --git a/tests/Unit/Fetcher/YoutubeFetcherTest.php b/tests/Unit/Fetcher/YoutubeFetcherTest.php index 28ddc2dc1..fbfd04c02 100644 --- a/tests/Unit/Fetcher/YoutubeFetcherTest.php +++ b/tests/Unit/Fetcher/YoutubeFetcherTest.php @@ -14,8 +14,9 @@ namespace OCA\News\Tests\Unit\Fetcher; use \OCA\News\Db\Feed; use OCA\News\Fetcher\YoutubeFetcher; +use PHPUnit\Framework\TestCase; -class YoutubeFetcherTest extends \PHPUnit_Framework_TestCase +class YoutubeFetcherTest extends TestCase { private $fetcher; diff --git a/tests/Unit/Http/TextDownloadResponseTest.php b/tests/Unit/Http/TextDownloadResponseTest.php index 96fa74ffc..4021d22aa 100644 --- a/tests/Unit/Http/TextDownloadResponseTest.php +++ b/tests/Unit/Http/TextDownloadResponseTest.php @@ -16,8 +16,9 @@ namespace OCA\News\Tests\Unit\Http; use OCA\News\Http\TextDownloadResponse; +use PHPUnit\Framework\TestCase; -class TextDownloadResponseTest extends \PHPUnit_Framework_TestCase +class TextDownloadResponseTest extends TestCase { diff --git a/tests/Unit/Http/TextResponseTest.php b/tests/Unit/Http/TextResponseTest.php index cd7738de5..5de374a17 100644 --- a/tests/Unit/Http/TextResponseTest.php +++ b/tests/Unit/Http/TextResponseTest.php @@ -14,10 +14,10 @@ namespace OCA\News\Tests\Unit\Http; - +use PHPUnit\Framework\TestCase; use OCA\News\Http\TextResponse; -class TextResponseTest extends \PHPUnit_Framework_TestCase +class TextResponseTest extends TestCase { 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; diff --git a/tests/Unit/Utility/OPMLExporterTest.php b/tests/Unit/Utility/OPMLExporterTest.php index 7f2c7dfdf..f02353100 100644 --- a/tests/Unit/Utility/OPMLExporterTest.php +++ b/tests/Unit/Utility/OPMLExporterTest.php @@ -16,9 +16,10 @@ namespace OCA\News\Tests\Unit\Utility; use \OCA\News\Db\Folder; use \OCA\News\Db\Feed; use OCA\News\Utility\OPMLExporter; +use PHPUnit\Framework\TestCase; -class OPMLExporterTest extends \PHPUnit_Framework_TestCase +class OPMLExporterTest extends TestCase { private $exporter; diff --git a/tests/Unit/Utility/ProxyConfigParserTest.php b/tests/Unit/Utility/ProxyConfigParserTest.php index a2a92fd38..34a7e4502 100644 --- a/tests/Unit/Utility/ProxyConfigParserTest.php +++ b/tests/Unit/Utility/ProxyConfigParserTest.php @@ -15,8 +15,9 @@ namespace OCA\News\Tests\Unit\Utility; use OCA\News\Utility\ProxyConfigParser; +use PHPUnit\Framework\TestCase; -class ProxyConfigParserTest extends \PHPUnit_Framework_TestCase +class ProxyConfigParserTest extends TestCase { private $config; diff --git a/tests/Unit/Utility/UpdaterTest.php b/tests/Unit/Utility/UpdaterTest.php index 87bbe31b9..3ebf47a9a 100644 --- a/tests/Unit/Utility/UpdaterTest.php +++ b/tests/Unit/Utility/UpdaterTest.php @@ -13,10 +13,10 @@ namespace OCA\News\Tests\Unit\Utility; - use OCA\News\Utility\Updater; +use PHPUnit\Framework\TestCase; -class UpdaterTest extends \PHPUnit_Framework_TestCase +class UpdaterTest extends TestCase { private $folderService; -- cgit v1.2.3