Skip to content

Commit

Permalink
Support version 6 and 7 of testframework
Browse files Browse the repository at this point in the history
  • Loading branch information
markusweigelt committed Sep 25, 2024
1 parent c5d13ea commit 5647de4
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions Tests/Unit/Validation/SaxonXslToSvrlValidatorTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@
use InvalidArgumentException;
use Kitodo\Dlf\Validation\SaxonXslToSvrlValidator;
use ReflectionClass;
use TYPO3\CMS\Core\Core\Environment;
use TYPO3\CMS\Extbase\Error\Result;
use TYPO3\TestingFramework\Core\Unit\UnitTestCase;

Expand All @@ -41,10 +42,13 @@ class SaxonXslToSvrlValidatorTest extends UnitTestCase
</svrl:schematron-output>
SVRL;

private string $dlfExtensionPath;

public function setUp(): void
{
parent::setUp();
$this->resetSingletonInstances = true;
$this->dlfExtensionPath = Environment::getExtensionsPath() . 'dlf';
}

public function testJarFileNotFound(): void
Expand All @@ -59,12 +63,12 @@ public function testXslFileNotFound(): void
$this->expectException(InvalidArgumentException::class);
$this->expectExceptionMessage("XSL Schematron file not found.");
// It only checks if a file exists at the specified path, so we can use one of the test files.
new SaxonXslToSvrlValidator(["jar" => 'EXT:dlf/Tests/Fixtures/Format/alto.xml']);
new SaxonXslToSvrlValidator(["jar" => $this->dlfExtensionPath . '/Tests/Fixtures/Format/alto.xml']);
}

public function testValidation(): void
{
$saxonXslToSvrlValidator = new SaxonXslToSvrlValidator(["jar" => 'EXT:dlf/Tests/Fixtures/Format/alto.xml', "xsl" => 'EXT:dlf/Tests/Fixtures/Format/alto.xml']);
$saxonXslToSvrlValidator = new SaxonXslToSvrlValidator(["jar" => $this->dlfExtensionPath . '/Tests/Fixtures/Format/alto.xml', "xsl" => $this->dlfExtensionPath . '/Tests/Fixtures/Format/alto.xml']);
$reflection = new ReflectionClass($saxonXslToSvrlValidator);

$result = $reflection->getProperty("result");
Expand Down

0 comments on commit 5647de4

Please sign in to comment.