From e1f9b2ab9e8a40568c9476c5cc0a868a7d62bd50 Mon Sep 17 00:00:00 2001 From: Charl Joseph Mert Date: Tue, 9 Feb 2010 15:21:42 +0200 Subject: [PATCH] Update Pear Libraries PT:1182700 --- tests/env/testPhpConfigurations.php | 44 ++++++++++++++++++++++++-------------------- tests/env/testSystemConfigurations.php | 3 ++- 2 files changed, 26 insertions(+), 21 deletions(-) diff --git a/tests/env/testPhpConfigurations.php b/tests/env/testPhpConfigurations.php index 806f925..24cdf75 100755 --- a/tests/env/testPhpConfigurations.php +++ b/tests/env/testPhpConfigurations.php @@ -321,32 +321,36 @@ class EnvPhpConfigTestCase extends KTUnitTestCase { * Testing maximumUploadSize */ function testMaximumUploadSize() { - $key = 'upload_max_filesize'; - $actualConfig = $this->getActualConfig($key); - $requiredConfig = $this->getRecommendedConfig($key); - - $byteSetting = $this->to_byte($actualConfig['setting']); - $byteRecommended = $this->to_byte($requiredConfig['recommended']); - //Testing that the byte conversion passed - $this->assertNotEqual($byteSetting, false, 'Could Not Convert Actual Setting to Bytes [' . $actualConfig['setting'] . ']'); - $result = ($byteSetting >= $byteRecommended); - $this->assertTrue($result, 'current php.ini conf value for '.$key.' ['.$actualConfig['setting'].'] is too small. The recommended size is ' . $requiredConfig['recommended']); + if (!ini_get('upload_max_filesize') == -1) { + $key = 'upload_max_filesize'; + $actualConfig = $this->getActualConfig($key); + $requiredConfig = $this->getRecommendedConfig($key); + + $byteSetting = $this->to_byte($actualConfig['setting']); + $byteRecommended = $this->to_byte($requiredConfig['recommended']); + //Testing that the byte conversion passed + $this->assertNotEqual($byteSetting, false, 'Could Not Convert Actual Setting to Bytes [' . $actualConfig['setting'] . ']'); + $result = ($byteSetting >= $byteRecommended); + $this->assertTrue($result, 'current php.ini conf value for '.$key.' ['.$actualConfig['setting'].'] is too small. The recommended size is ' . $requiredConfig['recommended']); + } } /** * Testing memoryLimit */ function testMemoryLimit() { - $key = 'memory_limit'; - $actualConfig = $this->getActualConfig($key); - $requiredConfig = $this->getRecommendedConfig($key); - - $byteSetting = $this->to_byte($actualConfig['setting']); - $byteRecommended = $this->to_byte($requiredConfig['recommended']); - //Testing that the byte conversion passed - $this->assertNotEqual($byteSetting, false, 'Could Not Convert Actual Setting to Bytes [' . $actualConfig['setting'] . ']'); - $result = ($byteSetting >= $byteRecommended); - $this->assertTrue($result, 'current php.ini conf value for '.$key.' ['.$actualConfig['setting'].'] is too small. The recommended size is ' . $requiredConfig['recommended']); + if (!ini_get('memory_limit') == -1) { + $key = 'memory_limit'; + $actualConfig = $this->getActualConfig($key); + $requiredConfig = $this->getRecommendedConfig($key); + + $byteSetting = $this->to_byte($actualConfig['setting']); + $byteRecommended = $this->to_byte($requiredConfig['recommended']); + //Testing that the byte conversion passed + $this->assertNotEqual($byteSetting, false, 'Could Not Convert Actual Setting to Bytes [' . $actualConfig['setting'] . ']'); + $result = ($byteSetting >= $byteRecommended); + $this->assertTrue($result, 'current php.ini conf value for '.$key.' ['.$actualConfig['setting'].'] is too small. The recommended size is ' . $requiredConfig['recommended']); + } } } diff --git a/tests/env/testSystemConfigurations.php b/tests/env/testSystemConfigurations.php index d759e1e..6ac2915 100644 --- a/tests/env/testSystemConfigurations.php +++ b/tests/env/testSystemConfigurations.php @@ -46,7 +46,8 @@ class EnvPhpSystemTestCase extends KTUnitTestCase { */ function testConfigFile() { $key = 'configFile'; - $this->assertEqual($this->arrPathInfo[$key]['class'], 'tick', $this->arrPathInfo[$key]['msg']); + $fileValid = (file_exists($this->arrPathInfo[$key]['path'])); + $this->assertTrue($fileValid, 'Config file : [' . $this->arrPathInfo[$key]['path'] . '] could not be found.'); } /** -- libgit2 0.21.4