-
-
Notifications
You must be signed in to change notification settings - Fork 3
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
## Description ## Checklist - [ ] Updated CHANGELOG files - [ ] Updated Documentation - [ ] Unit Tests Created - [ ] php-cs-fixer
- Loading branch information
1 parent
9cd723e
commit 5ad14f5
Showing
11 changed files
with
94 additions
and
34 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
/Tests export-ignore | ||
/phpunit.xml.dist export-ignore | ||
/.gitattributes export-ignore | ||
/.gitignore export-ignore |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
composer.lock | ||
phpunit.xml | ||
vendor/ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,44 @@ | ||
<?php | ||
|
||
declare(strict_types=1); | ||
|
||
namespace SonsOfPHP\Bard\Tests; | ||
|
||
use PHPUnit\Framework\TestCase; | ||
use SonsOfPHP\Bard\JsonFile; | ||
|
||
/** | ||
* @coversDefaultClass \SonsOfPHP\Bard\JsonFile | ||
* | ||
* @uses \SonsOfPHP\Bard\JsonFile | ||
* @uses \SonsOfPHP\Component\Json\AbstractEncoderDecoder | ||
* @uses \SonsOfPHP\Component\Json\Json | ||
* @uses \SonsOfPHP\Component\Json\JsonDecoder | ||
*/ | ||
final class JsonFileTest extends TestCase | ||
{ | ||
/** | ||
* @covers ::__construct | ||
* @covers ::load | ||
* @covers ::getFilename | ||
* @covers ::getSection | ||
*/ | ||
public function testGetFilename(): void | ||
{ | ||
$json = new JsonFile(__DIR__ . '/fixtures/test.json'); | ||
|
||
$this->assertIsString($json->getFilename()); | ||
} | ||
|
||
/** | ||
* @covers ::__construct | ||
* @covers ::load | ||
* @covers ::getSection | ||
*/ | ||
public function testGetSection(): void | ||
{ | ||
$json = new JsonFile(__DIR__ . '/fixtures/test.json'); | ||
|
||
$this->assertSame('1.2.3', $json->getSection('version')); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
{ | ||
"version": "1.2.3", | ||
"packages": [ | ||
{ | ||
"path": "path/to/Repo", | ||
"repository": "git@github.com:SonsOfPHP/read-only-repo.git" | ||
} | ||
] | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -67,4 +67,4 @@ | |
"url": "https://tidelift.com/subscription/pkg/packagist-sonsofphp-sonsofphp" | ||
} | ||
] | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters