Skip to content
Permalink
Browse files

Add test for #7224

  • Loading branch information...
chinpei215 committed Nov 29, 2015
1 parent 7bbdcb2 commit f2f8f3f1ea7ccb7eeb9858b6c9101674c9e9e0a5
Showing with 32 additions and 0 deletions.
  1. +32 −0 lib/Cake/Test/Case/Core/AppTest.php
@@ -829,4 +829,36 @@ public function testPluginLibClasses() {
App::uses('TestPluginOtherLibrary', 'TestPlugin.Lib');
$this->assertTrue(class_exists('TestPluginOtherLibrary'));
}
/**
* Test that increaseMemoryLimit increases the maximum amount of memory actually
*
* @dataProvider memoryVariationProvider
* @return void
*/
public function testIncreaseMemoryLimit($memoryLimit, $additionalKb, $expected) {
$this->skipIf(!function_exists('ini_set'));
$originalMemoryLimit = ini_get('memory_limit');
ini_set('memory_limit', $memoryLimit);
App::increaseMemoryLimit($additionalKb);
$this->assertEquals($expected, ini_get('memory_limit'));
ini_set('memory_limit', $originalMemoryLimit);
}
/**
* Data provider function for testIncreaseMemoryLimit
*
* @return
*/
public function memoryVariationProvider() {
return array(
array('131072K', 100000, '231072K'),
array('256M', 1, '262145K'),
array('1G', 1, '1048577K'),
array('-1', 100000, -1)
);
}
}

0 comments on commit f2f8f3f

Please sign in to comment.
You can’t perform that action at this time.