public function testMin() { // Arrange $a = [1, 2, 3]; // Act $x = __::min($a); // Assert $this->assertEquals(1, $x); }
header('LOCATION: index.php'); } if (!session_mayEdit($dbConnection)) { header('LOCATION: index.php'); } ?> <!DOCTYPE HTML> <html> <?php $title = "Import of .csv files."; $jsFiles = array('dbimport.js'); require_once 'head.php'; //<script type='application/javascript' src='js/main.js'></script> $max = ini_get_all(); $max = $max['max_file_uploads']; $max = __::min(array($max['global_value'], $max['local_value'])); ?> <body><?php require_once 'topmenu.php'; ?> <form class="form-inline"> <label> View the data for a LanguageFamily: <select name="languagefamily" id="select_languagefamily"></select> </label> </form> <div class="row-fluid"> <form class="form-horizontal span6"> <legend>Insert a new Languagefamily:</legend> <div class="control-group"> <label class="control-label" for="studyIx">StudyIx:</label>
public function testMin() { // from js $this->assertEquals(1, __::min(array(1, 2, 3)), 'can perform a regular min'); $this->assertEquals(3, __::min(array(1, 2, 3), function ($num) { return -$num; }), 'can performa a computation-based max'); // extra $stooges = array(array('name' => 'moe', 'age' => 40), array('name' => 'larry', 'age' => 50), array('name' => 'curly', 'age' => 60)); $this->assertEquals($stooges[0], __::min($stooges, function ($stooge) { return $stooge['age']; })); $this->assertEquals($stooges[2], __::min($stooges, function ($stooge) { return $stooge['name']; })); $this->assertEquals($stooges[2], __($stooges)->min(function ($stooge) { return $stooge['name']; }), 'works with OO-style call'); // docs $stooges = array(array('name' => 'moe', 'age' => 40), array('name' => 'larry', 'age' => 50), array('name' => 'curly', 'age' => 60)); $this->assertEquals(array('name' => 'moe', 'age' => 40), __::min($stooges, function ($stooge) { return $stooge['age']; })); }