Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix master branch #185

Merged
merged 2 commits into from
May 6, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
Loading