Commit e1f9b2ab9e8a40568c9476c5cc0a868a7d62bd50

Authored by Charl Joseph Mert
1 parent 8a3c37cb

Update Pear Libraries

PT:1182700

Test now passes when post_max_size and/or upload_max_filesize is -1. Also the config file is just reported on if it cannot be found.

Updated by: Charl Joseph Mert
tests/env/testPhpConfigurations.php
@@ -321,32 +321,36 @@ class EnvPhpConfigTestCase extends KTUnitTestCase { @@ -321,32 +321,36 @@ class EnvPhpConfigTestCase extends KTUnitTestCase {
321 * Testing maximumUploadSize 321 * Testing maximumUploadSize
322 */ 322 */
323 function testMaximumUploadSize() { 323 function testMaximumUploadSize() {
324 - $key = 'upload_max_filesize';  
325 - $actualConfig = $this->getActualConfig($key);  
326 - $requiredConfig = $this->getRecommendedConfig($key);  
327 -  
328 - $byteSetting = $this->to_byte($actualConfig['setting']);  
329 - $byteRecommended = $this->to_byte($requiredConfig['recommended']);  
330 - //Testing that the byte conversion passed  
331 - $this->assertNotEqual($byteSetting, false, 'Could Not Convert Actual Setting to Bytes [' . $actualConfig['setting'] . ']');  
332 - $result = ($byteSetting >= $byteRecommended);  
333 - $this->assertTrue($result, 'current php.ini conf value for '.$key.' ['.$actualConfig['setting'].'] is too small. The recommended size is ' . $requiredConfig['recommended']); 324 + if (!ini_get('upload_max_filesize') == -1) {
  325 + $key = 'upload_max_filesize';
  326 + $actualConfig = $this->getActualConfig($key);
  327 + $requiredConfig = $this->getRecommendedConfig($key);
  328 +
  329 + $byteSetting = $this->to_byte($actualConfig['setting']);
  330 + $byteRecommended = $this->to_byte($requiredConfig['recommended']);
  331 + //Testing that the byte conversion passed
  332 + $this->assertNotEqual($byteSetting, false, 'Could Not Convert Actual Setting to Bytes [' . $actualConfig['setting'] . ']');
  333 + $result = ($byteSetting >= $byteRecommended);
  334 + $this->assertTrue($result, 'current php.ini conf value for '.$key.' ['.$actualConfig['setting'].'] is too small. The recommended size is ' . $requiredConfig['recommended']);
  335 + }
334 } 336 }
335 337
336 /** 338 /**
337 * Testing memoryLimit 339 * Testing memoryLimit
338 */ 340 */
339 function testMemoryLimit() { 341 function testMemoryLimit() {
340 - $key = 'memory_limit';  
341 - $actualConfig = $this->getActualConfig($key);  
342 - $requiredConfig = $this->getRecommendedConfig($key);  
343 -  
344 - $byteSetting = $this->to_byte($actualConfig['setting']);  
345 - $byteRecommended = $this->to_byte($requiredConfig['recommended']);  
346 - //Testing that the byte conversion passed  
347 - $this->assertNotEqual($byteSetting, false, 'Could Not Convert Actual Setting to Bytes [' . $actualConfig['setting'] . ']');  
348 - $result = ($byteSetting >= $byteRecommended);  
349 - $this->assertTrue($result, 'current php.ini conf value for '.$key.' ['.$actualConfig['setting'].'] is too small. The recommended size is ' . $requiredConfig['recommended']); 342 + if (!ini_get('memory_limit') == -1) {
  343 + $key = 'memory_limit';
  344 + $actualConfig = $this->getActualConfig($key);
  345 + $requiredConfig = $this->getRecommendedConfig($key);
  346 +
  347 + $byteSetting = $this->to_byte($actualConfig['setting']);
  348 + $byteRecommended = $this->to_byte($requiredConfig['recommended']);
  349 + //Testing that the byte conversion passed
  350 + $this->assertNotEqual($byteSetting, false, 'Could Not Convert Actual Setting to Bytes [' . $actualConfig['setting'] . ']');
  351 + $result = ($byteSetting >= $byteRecommended);
  352 + $this->assertTrue($result, 'current php.ini conf value for '.$key.' ['.$actualConfig['setting'].'] is too small. The recommended size is ' . $requiredConfig['recommended']);
  353 + }
350 } 354 }
351 355
352 } 356 }
tests/env/testSystemConfigurations.php
@@ -46,7 +46,8 @@ class EnvPhpSystemTestCase extends KTUnitTestCase { @@ -46,7 +46,8 @@ class EnvPhpSystemTestCase extends KTUnitTestCase {
46 */ 46 */
47 function testConfigFile() { 47 function testConfigFile() {
48 $key = 'configFile'; 48 $key = 'configFile';
49 - $this->assertEqual($this->arrPathInfo[$key]['class'], 'tick', $this->arrPathInfo[$key]['msg']); 49 + $fileValid = (file_exists($this->arrPathInfo[$key]['path']));
  50 + $this->assertTrue($fileValid, 'Config file : [' . $this->arrPathInfo[$key]['path'] . '] could not be found.');
50 } 51 }
51 52
52 /** 53 /**