diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index 52b9c7b..7a1a398 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -5,15 +5,17 @@ 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 }} @@ -21,8 +23,5 @@ jobs: 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) diff --git a/composer.json b/composer.json index 795d760..7b19b3d 100644 --- a/composer.json +++ b/composer.json @@ -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", diff --git a/tests/CollectionTest.php b/tests/CollectionTest.php index da44b6a..7fbd44b 100644 --- a/tests/CollectionTest.php +++ b/tests/CollectionTest.php @@ -35,7 +35,7 @@ public function testExceptionOnInvalidEncoding() * * @return array */ - public function mrcFiles() + public static function mrcFiles() { return [ ['sandburg.mrc', 1], // Single binary MARC file @@ -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 @@ -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); diff --git a/tests/ExamplesTest.php b/tests/ExamplesTest.php index 48b84a3..e39c6f3 100644 --- a/tests/ExamplesTest.php +++ b/tests/ExamplesTest.php @@ -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]; } } diff --git a/tests/RecordTest.php b/tests/RecordTest.php index 2ae4f36..5649756 100644 --- a/tests/RecordTest.php +++ b/tests/RecordTest.php @@ -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]); } diff --git a/tests/TestCase.php b/tests/TestCase.php index 650969c..bc74f15 100644 --- a/tests/TestCase.php +++ b/tests/TestCase.php @@ -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)