Skip to content

Commit 821b873

Browse files
committed
Refactor test: Use expectException
1 parent 32f3168 commit 821b873

File tree

1 file changed

+5
-5
lines changed

1 file changed

+5
-5
lines changed

tests/CollectionTest.php

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@
33
namespace Tests;
44

55
use Scriptotek\Marc\Collection;
6+
use Scriptotek\Marc\Exceptions\XmlException;
67

78
class CollectionTest extends TestCase
89
{
@@ -30,13 +31,12 @@ public function testBibsysOaiPmhSample()
3031
}
3132

3233
/**
33-
* @expectedException Scriptotek\Marc\Exceptions\XmlException
34+
* Test that it XmlException is thrown when the specified encoding (UTF-16)
35+
* differs from the actual encoding (UTF-8).
3436
*/
35-
public function testAlmaBibsApiExample()
37+
public function testExceptionOnInvalidEncoding()
3638
{
37-
// Expect failure because of invalid encoding in XML declaration:
38-
// Document labelled UTF-16 but has UTF-8 content
39-
39+
$this->expectException(XmlException::class);
4040
$this->getTestCollection('alma-bibs-api-invalid.xml');
4141
}
4242

0 commit comments

Comments
 (0)