Skip to content

Commit

Permalink
Update to pear/file_marc@dev (#26)
Browse files Browse the repository at this point in the history
  • Loading branch information
danmichaelo authored Feb 27, 2024
1 parent 9299624 commit 057ab6d
Show file tree
Hide file tree
Showing 6 changed files with 14 additions and 15 deletions.
9 changes: 4 additions & 5 deletions .github/workflows/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,24 +5,23 @@ on: [push]
jobs:
test:
strategy:
fail-fast: false
matrix:
php:
- "8.0"
- "8.1"
- "8.2"
- "8.3"
runs-on: ubuntu-latest
name: PHP ${{ matrix.php }}
steps:
- uses: actions/checkout@v3
- uses: actions/checkout@v4
- uses: php-actions/composer@v6
with:
php_version: ${{ matrix.php }}
- uses: php-actions/phpstan@v3
with:
php_version: ${{ matrix.php }}
path: src/
- uses: php-actions/phpunit@v3
with:
php_version: ${{ matrix.php }}
php_extensions: pcov
- run: composer test
- run: bash <(curl -s https://codecov.io/bash)
2 changes: 1 addition & 1 deletion composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@
"ext-json": "*",
"ext-simplexml": "*",
"ck/file_marc_reference": "^1.2",
"pear/file_marc": "^1.4.1"
"pear/file_marc": "@dev"
},
"require-dev": {
"phpunit/phpunit": "^8.0 | ^9.0",
Expand Down
6 changes: 3 additions & 3 deletions tests/CollectionTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ public function testExceptionOnInvalidEncoding()
*
* @return array
*/
public function mrcFiles()
public static function mrcFiles()
{
return [
['sandburg.mrc', 1], // Single binary MARC file
Expand All @@ -48,7 +48,7 @@ public function mrcFiles()
*
* @return array
*/
public function xmlFiles()
public static function xmlFiles()
{
return [
['oaipmh-bibsys.xml', 89], // Records encapsulated in OAI-PMH response
Expand Down Expand Up @@ -86,7 +86,7 @@ public function testCollectionFromFile($filename, $expected)
*/
public function testInitializeFromSimpleXmlElement($filename, $expected)
{
$el = simplexml_load_file($this->pathTo($filename));
$el = simplexml_load_file(self::pathTo($filename));

$collection = Collection::fromSimpleXMLElement($el);

Expand Down
4 changes: 2 additions & 2 deletions tests/ExamplesTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -26,9 +26,9 @@ public function testExample($filename)
}
}

public function exampleDataProvider()
public static function exampleDataProvider()
{
foreach (glob($this->pathTo('examples/*.xml')) as $filename) {
foreach (glob(self::pathTo('examples/*.xml')) as $filename) {
yield [$filename];
}
}
Expand Down
4 changes: 2 additions & 2 deletions tests/RecordTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -71,13 +71,13 @@ public function testExampleWithCustomPrefix()

public function testBinaryMarc()
{
$record = Record::fromFile($this->pathTo('binary-marc.mrc'));
$record = Record::fromFile(self::pathTo('binary-marc.mrc'));
$this->assertInstanceOf(Record::class, $record);
}

public function testThatFieldObjectsAreReturned()
{
$record = Record::fromFile($this->pathTo('binary-marc.mrc'));
$record = Record::fromFile(self::pathTo('binary-marc.mrc'));
$this->assertInstanceOf(Field::class, $record->getField('020'));
$this->assertInstanceOf(Field::class, $record->getFields('020')[0]);
}
Expand Down
4 changes: 2 additions & 2 deletions tests/TestCase.php
Original file line number Diff line number Diff line change
Expand Up @@ -7,14 +7,14 @@

class TestCase extends \PHPUnit\Framework\TestCase
{
protected function pathTo($filename)
protected static function pathTo($filename)
{
return __DIR__ . '/data/' . $filename;
}

protected function getTestCollection($filename)
{
return Collection::fromFile($this->pathTo($filename));
return Collection::fromFile(self::pathTo($filename));
}

protected function getNthrecord($filename, $n)
Expand Down

0 comments on commit 057ab6d

Please sign in to comment.