Skip to content

Commit d00c4d5

Browse files
committed
Fix dataproviders in tests
1 parent 4242174 commit d00c4d5

File tree

4 files changed

+9
-9
lines changed

4 files changed

+9
-9
lines changed

tests/CollectionTest.php

+3-3
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,7 @@ public function testExceptionOnInvalidEncoding()
3535
*
3636
* @return array
3737
*/
38-
public function mrcFiles()
38+
public static function mrcFiles()
3939
{
4040
return [
4141
['sandburg.mrc', 1], // Single binary MARC file
@@ -48,7 +48,7 @@ public function mrcFiles()
4848
*
4949
* @return array
5050
*/
51-
public function xmlFiles()
51+
public static function xmlFiles()
5252
{
5353
return [
5454
['oaipmh-bibsys.xml', 89], // Records encapsulated in OAI-PMH response
@@ -86,7 +86,7 @@ public function testCollectionFromFile($filename, $expected)
8686
*/
8787
public function testInitializeFromSimpleXmlElement($filename, $expected)
8888
{
89-
$el = simplexml_load_file($this->pathTo($filename));
89+
$el = simplexml_load_file(self::pathTo($filename));
9090

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

tests/ExamplesTest.php

+2-2
Original file line numberDiff line numberDiff line change
@@ -26,9 +26,9 @@ public function testExample($filename)
2626
}
2727
}
2828

29-
public function exampleDataProvider()
29+
public static function exampleDataProvider()
3030
{
31-
foreach (glob($this->pathTo('examples/*.xml')) as $filename) {
31+
foreach (glob(self::pathTo('examples/*.xml')) as $filename) {
3232
yield [$filename];
3333
}
3434
}

tests/RecordTest.php

+2-2
Original file line numberDiff line numberDiff line change
@@ -71,13 +71,13 @@ public function testExampleWithCustomPrefix()
7171

7272
public function testBinaryMarc()
7373
{
74-
$record = Record::fromFile($this->pathTo('binary-marc.mrc'));
74+
$record = Record::fromFile(self::pathTo('binary-marc.mrc'));
7575
$this->assertInstanceOf(Record::class, $record);
7676
}
7777

7878
public function testThatFieldObjectsAreReturned()
7979
{
80-
$record = Record::fromFile($this->pathTo('binary-marc.mrc'));
80+
$record = Record::fromFile(self::pathTo('binary-marc.mrc'));
8181
$this->assertInstanceOf(Field::class, $record->getField('020'));
8282
$this->assertInstanceOf(Field::class, $record->getFields('020')[0]);
8383
}

tests/TestCase.php

+2-2
Original file line numberDiff line numberDiff line change
@@ -7,14 +7,14 @@
77

88
class TestCase extends \PHPUnit\Framework\TestCase
99
{
10-
protected function pathTo($filename)
10+
protected static function pathTo($filename)
1111
{
1212
return __DIR__ . '/data/' . $filename;
1313
}
1414

1515
protected function getTestCollection($filename)
1616
{
17-
return Collection::fromFile($this->pathTo($filename));
17+
return Collection::fromFile(self::pathTo($filename));
1818
}
1919

2020
protected function getNthrecord($filename, $n)

0 commit comments

Comments
 (0)