-
Notifications
You must be signed in to change notification settings - Fork 19
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
organize tests, fix error about splat operator where unpacking does n…
…ot work with assoc. arrays
- Loading branch information
1 parent
571d35b
commit a6bc412
Showing
16 changed files
with
291 additions
and
196 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
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -8,7 +8,7 @@ | |
{ | ||
"name": "Burak Özdemir", | ||
"email": "[email protected]", | ||
"homepage": "https://burakozdemir.co.uk" | ||
"homepage": "https://ozdemirburak.com" | ||
} | ||
], | ||
"require": { | ||
|
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 was deleted.
Oops, something went wrong.
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,49 @@ | ||
<?php | ||
|
||
namespace OzdemirBurak\JsonCsv\Tests\Traits; | ||
|
||
use OzdemirBurak\JsonCsv\File\Csv; | ||
use OzdemirBurak\JsonCsv\File\Json; | ||
|
||
trait TestTrait | ||
{ | ||
/** | ||
* @param string $file | ||
*/ | ||
private function checkConversion($file) | ||
{ | ||
$method = 'init' . str_replace('Test', '', substr(strrchr(\get_class($this), '\\'), 1)); | ||
$this->assertStringEqualsFile($this->path($file, $this->ext), $this->$method($file)->convert()); | ||
} | ||
|
||
/** | ||
* @param $file | ||
* @param string $extension | ||
* | ||
* @return string | ||
*/ | ||
private function path($file, $extension = 'csv'): string | ||
{ | ||
return __DIR__ . '/../data/' . $file . '.' . $extension; | ||
} | ||
|
||
/** | ||
* @param string $file | ||
* | ||
* @return \OzdemirBurak\JsonCsv\File\Csv | ||
*/ | ||
private function initCsv($file = 'iris'): Csv | ||
{ | ||
return new Csv($this->path($file, 'csv')); | ||
} | ||
|
||
/** | ||
* @param string $file | ||
* | ||
* @return \OzdemirBurak\JsonCsv\File\Json | ||
*/ | ||
private function initJson($file = 'countries'): Json | ||
{ | ||
return new Json($this->path($file, 'json')); | ||
} | ||
} |
This file was deleted.
Oops, something went wrong.
Oops, something went wrong.