From 29ce94ee2ad8c0ccb7d5eb063e0aad82e7568cd8 Mon Sep 17 00:00:00 2001 From: Mark Vejvoda Date: Wed, 7 Feb 2024 14:56:43 -0800 Subject: [PATCH] - fix failing unit tests --- php/phpunit.xml | 29 ++++++++------------------ php/tests/api-maps/apiMapsTest.php | 4 ++-- php/tests/config/configBuilderTest.php | 15 ++++++++----- 3 files changed, 21 insertions(+), 27 deletions(-) diff --git a/php/phpunit.xml b/php/phpunit.xml index 72d9548b..6e855655 100644 --- a/php/phpunit.xml +++ b/php/phpunit.xml @@ -1,28 +1,17 @@ - - + tests - - - + + ./ - - third-party - vendor - - - - + + + third-party + vendor + + diff --git a/php/tests/api-maps/apiMapsTest.php b/php/tests/api-maps/apiMapsTest.php index 84521e08..26765f61 100644 --- a/php/tests/api-maps/apiMapsTest.php +++ b/php/tests/api-maps/apiMapsTest.php @@ -55,8 +55,8 @@ public function testGetGEOCoordinatesFromAddress_Valid() { } else { $this->assertEquals(2, (is_array($geo_corrds) ? count($geo_corrds) : 0)); - $this->assertEquals('54.0873847', $geo_corrds[0]); - $this->assertEquals('-122.5898009', $geo_corrds[1]); + $this->assertEquals('54.0873532', $geo_corrds[0]); + $this->assertEquals('-122.5897507', $geo_corrds[1]); } } diff --git a/php/tests/config/configBuilderTest.php b/php/tests/config/configBuilderTest.php index c9164306..6f009abd 100644 --- a/php/tests/config/configBuilderTest.php +++ b/php/tests/config/configBuilderTest.php @@ -11,7 +11,7 @@ } require_once dirname(dirname(__FILE__)).'/baseDBFixture.php'; -$rootPath = dirname(dirname(dirname(__FILE__))); +//$rootPath = dirname(dirname(dirname(__FILE__))); class ConfigBuilderTest extends BaseDBFixture { @@ -26,16 +26,19 @@ protected function tearDown(): void { } public function testConfigBuilderLoad_ConfigInValid() { - global $rootPath; +// global $rootPath; try { - $rename_status1 = rename($rootPath.'/config.php', $rootPath.'/config-invalid.php'); + $rename_status1 = rename(__RIPRUNNER_ROOT__.'/config.php', __RIPRUNNER_ROOT__.'/config-invalid.php'); + + //echo '!!!!!!!!!!!!!!!!!!!: '.__RIPRUNNER_ROOT__.'/config-builder.php'.PHP_EOL; ob_start(); - require_once $rootPath.'/config-builder.php'; + require_once __RIPRUNNER_ROOT__.'/config-builder.php'; $unit_test_output = ob_get_clean(); $config_exists = file_exists('config.php'); } finally { - $rename_status2 = rename($rootPath.'/config-invalid.php', $rootPath.'/config.php'); + $rename_status2 = rename(__RIPRUNNER_ROOT__.'/config-invalid.php', __RIPRUNNER_ROOT__.'/config.php'); +// ob_end_flush(); } //echo "****** #1 TESTING ***** RENAME: [$rename_status] " . $unit_test_output . PHP_EOL; @@ -46,6 +49,8 @@ public function testConfigBuilderLoad_ConfigInValid() { $this->assertStringContainsString('', $unit_test_output); $this->assertStringContainsString('Rip Runner Configuration Generator', $unit_test_output); $this->assertStringContainsString('Generate Configuration', $unit_test_output); + + } }