Skip to content

Commit

Permalink
Fix master branch (#185)
Browse files Browse the repository at this point in the history
* fix psalm error

* fix coverage job

---------

Co-authored-by: Patrik Foldes <[email protected]>
  • Loading branch information
sspat and Patrik Foldes authored May 6, 2024
1 parent f85a01f commit ac5c881
Show file tree
Hide file tree
Showing 3 changed files with 1 addition and 26 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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 }}
Expand Down
5 changes: 0 additions & 5 deletions src/Specification/SpecificationLoader.php
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down Expand Up @@ -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));
}
Expand Down
20 changes: 0 additions & 20 deletions test/functional/Specification/SpecificationLoaderTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -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';
Expand Down

0 comments on commit ac5c881

Please sign in to comment.