2 /* vim: set expandtab sw=4 ts=4 sts=4: */
4 * Test for PMA_browseUploadFile from common.lib
6 * @package phpMyAdmin-test
7 * @version $Id: PMA_browseUploadFile_test.php
8 * @group common.lib-tests
14 require_once 'libraries/common.lib.php';
16 class PMA_browseUploadFile_test
extends PHPUnit_Extensions_OutputTestCase
{
19 * Data provider for test
21 public function dataProvider() {
23 array(10, __('B'), "10"),
24 array(100, __('B'), "100"),
25 array(1024, __('B'), "1,024"),
26 array(102400, __('KiB'), "100"),
27 array(10240000, __('MiB'), "10"),
28 array(2147483648, __('MiB'), "2,048"),
29 array(21474836480, __('GiB'), "20")
34 * @dataProvider dataProvider
37 function testBrowseUploadFile($size, $unit, $res){
39 $this->expectOutputString('<label for="radio_import_file">' . __("Browse your computer:") . '</label>'
40 . '<div id="upload_form_status" style="display: none;"></div>'
41 . '<div id="upload_form_status_info" style="display: none;"></div>'
42 . '<input type="file" name="import_file" id="input_import_file" />'
43 . "(" . __('Max: '). $res . $unit .")" . "\n"
44 . '<input type="hidden" name="MAX_FILE_SIZE" value="' .$size . '" />' . "\n");
46 PMA_browseUploadFile($size);