From 7a2b3ccfa8835c461ffca89ead1ecf76ea90ba1e Mon Sep 17 00:00:00 2001 From: Sean Molenaar Date: Thu, 25 Mar 2021 22:57:28 +0100 Subject: chore: Improve test coverage Signed-off-by: Sean Molenaar --- tests/Unit/Config/FetcherConfigTest.php | 65 +++++++++++++++++++++++++++++++++ 1 file changed, 65 insertions(+) create mode 100644 tests/Unit/Config/FetcherConfigTest.php (limited to 'tests/Unit/Config/FetcherConfigTest.php') diff --git a/tests/Unit/Config/FetcherConfigTest.php b/tests/Unit/Config/FetcherConfigTest.php new file mode 100644 index 000000000..6f5364490 --- /dev/null +++ b/tests/Unit/Config/FetcherConfigTest.php @@ -0,0 +1,65 @@ + + * + * @license AGPL-3.0 + * + * This code is free software: you can redistribute it and/or modify + * it under the terms of the GNU Affero General Public License, version 3, + * as published by the Free Software Foundation. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU Affero General Public License for more details. + * + * You should have received a copy of the GNU Affero General Public License, version 3, + * along with this program. If not, see + * + */ + +namespace OCA\News\Tests\Config; + +use OCA\News\Command\Debug\ItemList; +use OCA\News\Command\Updater\UpdateFeed; +use OCA\News\Config\FetcherConfig; +use OCA\News\Fetcher\Client\FeedIoClient; +use OCA\News\Service\ItemServiceV2; +use OCP\IConfig; +use PHPUnit\Framework\MockObject\MockObject; +use PHPUnit\Framework\TestCase; +use Symfony\Component\Console\Input\InputInterface; +use Symfony\Component\Console\Output\OutputInterface; + +/** + * Class FetcherConfigTest + * + * TODO: Improve this + * + * @package OCA\News\Tests\Config + */ +class FetcherConfigTest extends TestCase +{ + /** @var MockObject|IConfig */ + protected $config; + + /** @var FetcherConfig */ + protected $class; + + protected function setUp(): void + { + $this->config = $this->getMockBuilder(IConfig::class) + ->disableOriginalConstructor() + ->getMock(); + } + + /** + * Test a valid call will work + */ + public function testGetClient() + { + $this->class = new FetcherConfig($this->config); + + $this->assertInstanceOf(FeedIoClient::class, $this->class->getClient()); + } +} -- cgit v1.2.3