From 559329c98bb819703b36d653ad4d5fceb798fbda Mon Sep 17 00:00:00 2001 From: Ewout Pieter den Ouden Date: Thu, 31 May 2018 15:23:45 +0200 Subject: [PATCH] Use existing constant from bootstrap to fix PHPStan error Via https://github.com/phpstan/phpstan/issues/768 --- tests/Util/ConfigurationTest.php | 5 ++--- tests/_files/configuration.xml | 2 +- tests/_files/configuration_xinclude.xml | 2 +- 3 files changed, 4 insertions(+), 5 deletions(-) diff --git a/tests/Util/ConfigurationTest.php b/tests/Util/ConfigurationTest.php index d598cccca69..ee61fa8e944 100644 --- a/tests/Util/ConfigurationTest.php +++ b/tests/Util/ConfigurationTest.php @@ -286,7 +286,7 @@ public function testPHPConfigurationIsReadCorrectly(): void \dirname(__DIR__) . DIRECTORY_SEPARATOR . '_files' . DIRECTORY_SEPARATOR . '.', '/path/to/lib' ], - 'ini' => ['foo' => ['value' => 'bar'], 'highlight.keyword' => ['value' => '#123456'], 'highlight.string' => ['value' => 'TEST_CONFIG_INI_CONSTANT']], + 'ini' => ['foo' => ['value' => 'bar'], 'highlight.keyword' => ['value' => '#123456'], 'highlight.string' => ['value' => 'TEST_FILES_PATH']], 'const' => ['FOO' => ['value' => false], 'BAR' => ['value' => true]], 'var' => ['foo' => ['value' => false]], 'env' => ['foo' => ['value' => true], 'bar' => ['value' => 'true', 'verbatim' => true], 'foo_force' => ['value' => 'forced', 'force' => true]], @@ -306,7 +306,6 @@ public function testPHPConfigurationIsReadCorrectly(): void */ public function testPHPConfigurationIsHandledCorrectly(): void { - \define('TEST_CONFIG_INI_CONSTANT', '#234567'); $savedIniHighlightKeyword = \ini_get('highlight.keyword'); $savedIniHighlightString = \ini_get('highlight.string'); @@ -315,7 +314,7 @@ public function testPHPConfigurationIsHandledCorrectly(): void $path = \dirname(__DIR__) . DIRECTORY_SEPARATOR . '_files' . DIRECTORY_SEPARATOR . '.' . PATH_SEPARATOR . '/path/to/lib'; $this->assertStringStartsWith($path, \ini_get('include_path')); $this->assertEquals('#123456', \ini_get('highlight.keyword')); - $this->assertEquals(TEST_CONFIG_INI_CONSTANT, \ini_get('highlight.string')); + $this->assertEquals(TEST_FILES_PATH, \ini_get('highlight.string')); $this->assertFalse(\FOO); $this->assertTrue(\BAR); $this->assertFalse($GLOBALS['foo']); diff --git a/tests/_files/configuration.xml b/tests/_files/configuration.xml index 15f1a63f049..1fc340fad2f 100644 --- a/tests/_files/configuration.xml +++ b/tests/_files/configuration.xml @@ -144,7 +144,7 @@ /path/to/lib - + diff --git a/tests/_files/configuration_xinclude.xml b/tests/_files/configuration_xinclude.xml index 8766b5f7c53..536d461351b 100644 --- a/tests/_files/configuration_xinclude.xml +++ b/tests/_files/configuration_xinclude.xml @@ -65,7 +65,7 @@ /path/to/lib - +