Skip to content

Commit

Permalink
fixing a few deprecations, adding 8.4 to test matrix
Browse files Browse the repository at this point in the history
  • Loading branch information
dcarbone committed Dec 26, 2024
1 parent 90fd2e6 commit 53c965f
Show file tree
Hide file tree
Showing 10 changed files with 56 additions and 17 deletions.
3 changes: 3 additions & 0 deletions .github/workflows/tests.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -67,6 +67,7 @@ jobs:
- '8.1'
- '8.2'
- '8.3'
- '8.4'
fhir-version:
- 'DSTU1'
- 'DSTU2'
Expand All @@ -80,6 +81,8 @@ jobs:
phpunit-version: '11.1'
- php-version: '8.3'
phpunit-version: '11.1'
- php-version: '8.3'
phpunit-version: '11.1'

name: '${{ matrix.fhir-version }} - PHP ${{ matrix.php-version }} - PHPUnit ${{ matrix.phpunit-version }}'
steps:
Expand Down
8 changes: 7 additions & 1 deletion phpunit/Core.xml
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,13 @@
xsi:noNamespaceSchemaLocation="https://schema.phpunit.de/10.5/phpunit.xsd"
bootstrap="bootstrap.php"
colors="true"
stopOnFailure="false">
stopOnFailure="false"
displayDetailsOnIncompleteTests="true"
displayDetailsOnSkippedTests="true"
displayDetailsOnTestsThatTriggerDeprecations="true"
displayDetailsOnTestsThatTriggerWarnings="true"
displayDetailsOnTestsThatTriggerErrors="true"
displayDetailsOnTestsThatTriggerNotices="true">
<php>
<ini name="memory_limit" value="2048M"/>
</php>
Expand Down
8 changes: 7 additions & 1 deletion phpunit/DSTU1.xml
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,13 @@
xsi:noNamespaceSchemaLocation="https://schema.phpunit.de/10.5/phpunit.xsd"
bootstrap="bootstrap.php"
colors="true"
stopOnFailure="false">
stopOnFailure="false"
displayDetailsOnIncompleteTests="true"
displayDetailsOnSkippedTests="true"
displayDetailsOnTestsThatTriggerDeprecations="true"
displayDetailsOnTestsThatTriggerWarnings="true"
displayDetailsOnTestsThatTriggerErrors="true"
displayDetailsOnTestsThatTriggerNotices="true">
<php>
<ini name="memory_limit" value="2048M"/>
</php>
Expand Down
8 changes: 7 additions & 1 deletion phpunit/DSTU2.xml
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,13 @@
xsi:noNamespaceSchemaLocation="https://schema.phpunit.de/10.5/phpunit.xsd"
bootstrap="bootstrap.php"
colors="true"
stopOnFailure="false">
stopOnFailure="false"
displayDetailsOnIncompleteTests="true"
displayDetailsOnSkippedTests="true"
displayDetailsOnTestsThatTriggerDeprecations="true"
displayDetailsOnTestsThatTriggerWarnings="true"
displayDetailsOnTestsThatTriggerErrors="true"
displayDetailsOnTestsThatTriggerNotices="true">
<php>
<ini name="memory_limit" value="2048M"/>
<env name="PHPFHIR_TEST_INTEGRATION_ENDPOINT" value="https://hapi.fhir.org/baseDstu2" force="true"/>
Expand Down
8 changes: 7 additions & 1 deletion phpunit/R4.xml
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,13 @@
xsi:noNamespaceSchemaLocation="https://schema.phpunit.de/10.5/phpunit.xsd"
bootstrap="bootstrap.php"
colors="true"
stopOnFailure="false">
stopOnFailure="false"
displayDetailsOnIncompleteTests="true"
displayDetailsOnSkippedTests="true"
displayDetailsOnTestsThatTriggerDeprecations="true"
displayDetailsOnTestsThatTriggerWarnings="true"
displayDetailsOnTestsThatTriggerErrors="true"
displayDetailsOnTestsThatTriggerNotices="true">
<php>
<ini name="memory_limit" value="2048M"/>
<env name="PHPFHIR_TEST_INTEGRATION_ENDPOINT" value="https://lforms-fhir.nlm.nih.gov/baseR4" force="true"/>
Expand Down
8 changes: 7 additions & 1 deletion phpunit/R5.xml
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,13 @@
xsi:noNamespaceSchemaLocation="https://schema.phpunit.de/10.5/phpunit.xsd"
bootstrap="bootstrap.php"
colors="true"
stopOnFailure="false">
stopOnFailure="false"
displayDetailsOnIncompleteTests="true"
displayDetailsOnSkippedTests="true"
displayDetailsOnTestsThatTriggerDeprecations="true"
displayDetailsOnTestsThatTriggerWarnings="true"
displayDetailsOnTestsThatTriggerErrors="true"
displayDetailsOnTestsThatTriggerNotices="true">
<php>
<ini name="memory_limit" value="2048M"/>
<env name="PHPFHIR_TEST_INTEGRATION_ENDPOINT" value="https://server.fire.ly/r5" force="true"/>
Expand Down
8 changes: 7 additions & 1 deletion phpunit/STU3.xml
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,13 @@
xsi:noNamespaceSchemaLocation="https://schema.phpunit.de/10.5/phpunit.xsd"
bootstrap="bootstrap.php"
colors="true"
stopOnFailure="false">
stopOnFailure="false"
displayDetailsOnIncompleteTests="true"
displayDetailsOnSkippedTests="true"
displayDetailsOnTestsThatTriggerDeprecations="true"
displayDetailsOnTestsThatTriggerWarnings="true"
displayDetailsOnTestsThatTriggerErrors="true"
displayDetailsOnTestsThatTriggerNotices="true">
<php>
<ini name="memory_limit" value="2048M"/>
<env name="PHPFHIR_TEST_INTEGRATION_ENDPOINT" value="https://lforms-fhir.nlm.nih.gov/baseDstu3" force="true"/>
Expand Down
8 changes: 4 additions & 4 deletions phpunit/bootstrap.php
Original file line number Diff line number Diff line change
Expand Up @@ -21,17 +21,17 @@
const PHPFHIR_TEST_CONFIG_ROOT_DIR = __DIR__;
const PHPFHIR_TEST_RESOURCE_DOWNLOAD_DIR = PHPFHIR_TEST_CONFIG_ROOT_DIR . '/../output/tests/resources';

echo 'Creating test resource download dir: ' . PHPFHIR_TEST_CONFIG_ROOT_DIR . '/../output/tests/resources' . PHP_EOL;
echo 'Creating test resource download dir: ' . PHPFHIR_TEST_RESOURCE_DOWNLOAD_DIR . PHP_EOL;

if (!mkdir(PHPFHIR_TEST_RESOURCE_DOWNLOAD_DIR, 0755, true)) {
if (!is_dir(PHPFHIR_TEST_RESOURCE_DOWNLOAD_DIR) && !mkdir(PHPFHIR_TEST_RESOURCE_DOWNLOAD_DIR, 0755, true)) {
throw new \RuntimeException(sprintf('Failed to create test resource download directory: %s', PHPFHIR_TEST_RESOURCE_DOWNLOAD_DIR));
}

# define env to be used in tests
putenv('PHPFHIR_TEST_RESOURCE_DOWNLOAD_DIR='.PHPFHIR_TEST_RESOURCE_DOWNLOAD_DIR);

const PHPFHIR_TEST_COMPOSER_AUTOLOADER_PATH = __DIR__ . '/../vendor/autoload.php';
const PHPFHIR_TETS_GENERATED_AUTOLOADER_PATH = __DIR__ . '/../output/DCarbone/PHPFHIRGenerated/Autoloader.php';
const PHPFHIR_TEST_COMPOSER_AUTOLOADER_PATH = PHPFHIR_TEST_CONFIG_ROOT_DIR . '/../vendor/autoload.php';
const PHPFHIR_TETS_GENERATED_AUTOLOADER_PATH = PHPFHIR_TEST_CONFIG_ROOT_DIR . '/../output/DCarbone/PHPFHIRGenerated/Autoloader.php';

$composerAutoloader = realpath(PHPFHIR_TEST_COMPOSER_AUTOLOADER_PATH);
$generatedAutoloader = realpath(PHPFHIR_TETS_GENERATED_AUTOLOADER_PATH);
Expand Down
12 changes: 6 additions & 6 deletions template/core/classes/class_serialize_config.php
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,7 @@ public function __construct(array $config)
*/
public function setRootXMLNS(string $rootXMLNS): self
{
$this->rootXMLNS = $rootXMLNS;
$this->_rootXMLNS = $rootXMLNS;
return $this;
}

Expand All @@ -64,7 +64,7 @@ public function setRootXMLNS(string $rootXMLNS): self
*/
public function getRootXMLNS(): null|string
{
return $this->rootXMLNS ?? null;
return $this->_rootXMLNS ?? null;
}

/**
Expand All @@ -75,7 +75,7 @@ public function getRootXMLNS(): null|string
*/
public function setOverrideSourceXMLNS(bool $overrideSourceXMLNS): self
{
$this->overrideSourceXMLNS = $overrideSourceXMLNS;
$this->_overrideSourceXMLNS = $overrideSourceXMLNS;
return $this;
}

Expand All @@ -84,7 +84,7 @@ public function setOverrideSourceXMLNS(bool $overrideSourceXMLNS): self
*/
public function getOverrideSourceXMLNS(): bool
{
return $this->overrideSourceXMLNS ?? false;
return $this->_overrideSourceXMLNS ?? false;
}

/**
Expand All @@ -93,7 +93,7 @@ public function getOverrideSourceXMLNS(): bool
*/
public function setXHTMLLibxmlOpts(int $xhtmlLibxmlOpts): self
{
$this->xhtmlLibxmlOpts = $xhtmlLibxmlOpts;
$this->_xhtmlLibxmlOpts = $xhtmlLibxmlOpts;
return $this;
}

Expand All @@ -102,7 +102,7 @@ public function setXHTMLLibxmlOpts(int $xhtmlLibxmlOpts): self
*/
public function getXHTMLLibxmlOpts(): int
{
return $this->xhtmlLibxmlOpts ?? 0;
return $this->_xhtmlLibxmlOpts ?? 0;
}
}
<?php return ob_get_clean();
2 changes: 1 addition & 1 deletion template/core/interfaces/interface_type.php
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,7 @@ public function _getValidationErrors(): array;
* @param null|<?php echo $config->getFullyQualifiedName(true, PHPFHIR_CLASSNAME_UNSERIALIZE_CONFIG); ?> $config
* @return null|static
*/
public static function xmlUnserialize(null|string|\SimpleXMLElement $element, <?php echo PHPFHIR_INTERFACE_TYPE; ?> $type = null, null|<?php echo PHPFHIR_CLASSNAME_UNSERIALIZE_CONFIG ?> $config = null): null|self;
public static function xmlUnserialize(null|string|\SimpleXMLElement $element, null|<?php echo PHPFHIR_INTERFACE_TYPE; ?> $type = null, null|<?php echo PHPFHIR_CLASSNAME_UNSERIALIZE_CONFIG ?> $config = null): null|self;

/**
* @param null|<?php echo $config->getFullyQualifiedName(true, PHPFHIR_CLASSNAME_XML_WRITER); ?> $xw
Expand Down

0 comments on commit 53c965f

Please sign in to comment.