From ac5c88131f8b24293afc464032dd5fd4eecbc640 Mon Sep 17 00:00:00 2001 From: sspat Date: Mon, 6 May 2024 15:05:45 +0300 Subject: [PATCH] Fix master branch (#185) * fix psalm error * fix coverage job --------- Co-authored-by: Patrik Foldes --- .github/workflows/ci.yml | 2 +- src/Specification/SpecificationLoader.php | 5 ----- .../Specification/SpecificationLoaderTest.php | 20 ------------------- 3 files changed, 1 insertion(+), 26 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 1b18d32..d618c58 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -158,7 +158,7 @@ jobs: - name: "Code coverage" run: | vendor/bin/phpunit --testsuite=unit,functional --coverage-clover build/logs/clover.xml - wget https://github.com/php-coveralls/php-coveralls/releases/download/v2.1.0/php-coveralls.phar + wget https://github.com/php-coveralls/php-coveralls/releases/download/v2.7.0/php-coveralls.phar php php-coveralls.phar --verbose env: COVERALLS_REPO_TOKEN: ${{ secrets.COVERALLS_REPO_TOKEN }} diff --git a/src/Specification/SpecificationLoader.php b/src/Specification/SpecificationLoader.php index 704246f..74471f5 100644 --- a/src/Specification/SpecificationLoader.php +++ b/src/Specification/SpecificationLoader.php @@ -16,7 +16,6 @@ use function array_keys; use function file_exists; use function implode; -use function is_string; use function pathinfo; use function Safe\sprintf; use function stream_is_local; @@ -93,10 +92,6 @@ private function parseSpecification(string $specificationName, SpecificationConf { $specPath = $this->locator->locate($specificationConfig->getPath()); - if (! is_string($specPath)) { - throw new Exception(sprintf('More than one file path found for specification "%s".', $specificationConfig->getPath())); - } - if (! stream_is_local($specPath)) { throw new Exception(sprintf('This is not a local file "%s".', $specPath)); } diff --git a/test/functional/Specification/SpecificationLoaderTest.php b/test/functional/Specification/SpecificationLoaderTest.php index 2d5180c..c8bcfba 100644 --- a/test/functional/Specification/SpecificationLoaderTest.php +++ b/test/functional/Specification/SpecificationLoaderTest.php @@ -205,26 +205,6 @@ public function testGetReturnsSpecification(): void Assert::assertEquals($expectedSpecificationConfig, $specificationConfig); } - public function testLoadMoreThenOneSpecificationFilePathThrowsException(): void - { - $specificationFileName = 'test1'; - $this->fileLocator->expects(self::once()) - ->method('locate') - ->willReturn(['test1', 'test2']); - $specificationLoader = new SpecificationLoader( - $this->specificationParser, - $this->fileLocator, - $this->cache - ); - $specificationArray = $this->getSpecificationArray($specificationFileName); - - $specificationLoader->registerSpec(self::SPECIFICATION_NAME, $specificationArray); - $this->expectException(Exception::class); - $this->expectExceptionMessage(sprintf('More than one file path found for specification "%s".', __DIR__ . '/' . $specificationFileName)); - - $specificationLoader->load(self::SPECIFICATION_NAME); - } - public function testLoadNotLocalSpecificationFileThrowsException(): void { $specificationFileName = 'https://missed_specification.spec';