Merge remote-tracking branch 'origin/master'
This commit is contained in:
commit
68f40c2bf7
@ -844,7 +844,7 @@ class PMA_DisplayResults_test extends PHPUnit_Framework_TestCase
|
||||
'DELETE FROM `data`.`new` WHERE `new`.`id` = 1',
|
||||
'[%_PMA_CHECKBOX_DIR_%]',
|
||||
'odd row_0 vpointer vmarker',
|
||||
'<td class="odd row_0 vpointer vmarker" class="center"><input type="checkbox" id="id_rows_to_delete0[%_PMA_CHECKBOX_DIR_%]" name="rows_to_delete[0]" class="multi_checkbox" value="%60new%60.%60id%60+%3D+1" /><input type="hidden" class="condition_array" value="{"`new`.`id`":"= 1"}" /> </td>'
|
||||
'<td class="odd row_0 vpointer vmarker" class="center"><input type="checkbox" id="id_rows_to_delete0[%_PMA_CHECKBOX_DIR_%]" name="rows_to_delete[0]" class="multi_checkbox checkall" value="%60new%60.%60id%60+%3D+1" /><input type="hidden" class="condition_array" value="{"`new`.`id`":"= 1"}" /> </td>'
|
||||
)
|
||||
);
|
||||
}
|
||||
@ -1070,7 +1070,7 @@ class PMA_DisplayResults_test extends PHPUnit_Framework_TestCase
|
||||
'<span class="nowrap"><img src="themes/dot.gif" title="Copy" alt="Copy" class="icon ic_b_insrow" /> Copy</span>',
|
||||
'<span class="nowrap"><img src="themes/dot.gif" title="Delete" alt="Delete" class="icon ic_b_drop" /> Delete</span>',
|
||||
'DELETE FROM `data`.`new` WHERE `new`.`id` = 1',
|
||||
'<td class="center"><input type="checkbox" id="id_rows_to_delete0_left" name="rows_to_delete[0]" class="multi_checkbox" value="%60new%60.%60id%60+%3D+1" /><input type="hidden" class="condition_array" value="{"`new`.`id`":"= 1"}" /> </td><td class="edit_row_anchor center" ><span class="nowrap">
|
||||
'<td class="center"><input type="checkbox" id="id_rows_to_delete0_left" name="rows_to_delete[0]" class="multi_checkbox checkall" value="%60new%60.%60id%60+%3D+1" /><input type="hidden" class="condition_array" value="{"`new`.`id`":"= 1"}" /> </td><td class="edit_row_anchor center" ><span class="nowrap">
|
||||
<a href="tbl_change.php?db=data&table=new&where_clause=%60new%60.%60id%60+%3D+1&clause_is_unique=1&sql_query=SELECT+%2A+FROM+%60new%60&goto=sql.php&default_action=update&token=ae4c6d18375f446dfa068420c1f6a4e8" ><span class="nowrap"><img src="themes/dot.gif" title="Edit" alt="Edit" class="icon ic_b_edit" /> Edit</span></a>
|
||||
<input type="hidden" class="where_clause" value ="%60new%60.%60id%60+%3D+1" /></span></td><td class="center" ><span class="nowrap">
|
||||
<a href="tbl_change.php?db=data&table=new&where_clause=%60new%60.%60id%60+%3D+1&clause_is_unique=1&sql_query=SELECT+%2A+FROM+%60new%60&goto=sql.php&default_action=insert&token=ae4c6d18375f446dfa068420c1f6a4e8" ><span class="nowrap"><img src="themes/dot.gif" title="Copy" alt="Copy" class="icon ic_b_insrow" /> Copy</span></a>
|
||||
@ -1167,7 +1167,7 @@ class PMA_DisplayResults_test extends PHPUnit_Framework_TestCase
|
||||
<a href="tbl_change.php?db=data&table=new&where_clause=%60new%60.%60id%60+%3D+1&clause_is_unique=1&sql_query=SELECT+%2A+FROM+%60new%60&goto=sql.php&default_action=insert&token=ae4c6d18375f446dfa068420c1f6a4e8" ><span class="nowrap"><img src="themes/dot.gif" title="Copy" alt="Copy" class="icon ic_b_insrow" /> Copy</span></a>
|
||||
<input type="hidden" class="where_clause" value="%60new%60.%60id%60+%3D+1" /></span></td><td class="edit_row_anchor center" ><span class="nowrap">
|
||||
<a href="tbl_change.php?db=data&table=new&where_clause=%60new%60.%60id%60+%3D+1&clause_is_unique=1&sql_query=SELECT+%2A+FROM+%60new%60&goto=sql.php&default_action=update&token=ae4c6d18375f446dfa068420c1f6a4e8" ><span class="nowrap"><img src="themes/dot.gif" title="Edit" alt="Edit" class="icon ic_b_edit" /> Edit</span></a>
|
||||
<input type="hidden" class="where_clause" value ="%60new%60.%60id%60+%3D+1" /></span></td><td class="center"><input type="checkbox" id="id_rows_to_delete0_right" name="rows_to_delete[0]" class="multi_checkbox" value="%60new%60.%60id%60+%3D+1" /><input type="hidden" class="condition_array" value="{"`new`.`id`":"= 1"}" /> </td>'
|
||||
<input type="hidden" class="where_clause" value ="%60new%60.%60id%60+%3D+1" /></span></td><td class="center"><input type="checkbox" id="id_rows_to_delete0_right" name="rows_to_delete[0]" class="multi_checkbox checkall" value="%60new%60.%60id%60+%3D+1" /><input type="hidden" class="condition_array" value="{"`new`.`id`":"= 1"}" /> </td>'
|
||||
)
|
||||
);
|
||||
}
|
||||
@ -1252,7 +1252,7 @@ class PMA_DisplayResults_test extends PHPUnit_Framework_TestCase
|
||||
'<span class="nowrap"><img src="themes/dot.gif" title="Copy" alt="Copy" class="icon ic_b_insrow" /> Copy</span>',
|
||||
'<span class="nowrap"><img src="themes/dot.gif" title="Delete" alt="Delete" class="icon ic_b_drop" /> Delete</span>',
|
||||
'DELETE FROM `data`.`new` WHERE `new`.`id` = 1',
|
||||
'<td class="center"><input type="checkbox" id="id_rows_to_delete0_left" name="rows_to_delete[0]" class="multi_checkbox" value="%60new%60.%60id%60+%3D+1" /><input type="hidden" class="condition_array" value="{"`new`.`id`":"= 1"}" /> </td>'
|
||||
'<td class="center"><input type="checkbox" id="id_rows_to_delete0_left" name="rows_to_delete[0]" class="multi_checkbox checkall" value="%60new%60.%60id%60+%3D+1" /><input type="hidden" class="condition_array" value="{"`new`.`id`":"= 1"}" /> </td>'
|
||||
)
|
||||
);
|
||||
}
|
||||
@ -1351,7 +1351,7 @@ class PMA_DisplayResults_test extends PHPUnit_Framework_TestCase
|
||||
'<span class="nowrap"><img src="themes/dot.gif" title="Copy" alt="Copy" class="icon ic_b_insrow" /> Copy</span>',
|
||||
'<span class="nowrap"><img src="themes/dot.gif" title="Delete" alt="Delete" class="icon ic_b_drop" /> Delete</span>',
|
||||
null,
|
||||
'<td class="center"><input type="checkbox" id="id_rows_to_delete0_left" name="rows_to_delete[0]" class="multi_checkbox" value="%60new%60.%60id%60+%3D+1" /><input type="hidden" class="condition_array" value="{"`new`.`id`":"= 1"}" /> </td>'
|
||||
'<td class="center"><input type="checkbox" id="id_rows_to_delete0_left" name="rows_to_delete[0]" class="multi_checkbox checkall" value="%60new%60.%60id%60+%3D+1" /><input type="hidden" class="condition_array" value="{"`new`.`id`":"= 1"}" /> </td>'
|
||||
)
|
||||
);
|
||||
}
|
||||
|
||||
102
test/libraries/PMA_Zip_test.php
Normal file
102
test/libraries/PMA_Zip_test.php
Normal file
@ -0,0 +1,102 @@
|
||||
<?php
|
||||
/**
|
||||
* Tests for displaing results
|
||||
*
|
||||
* @package PhpMyAdmin-test
|
||||
*/
|
||||
|
||||
/*
|
||||
* Include to test.
|
||||
*/
|
||||
|
||||
require_once 'libraries/zip.lib.php';
|
||||
|
||||
class PMA_Zip_test extends PHPUnit_Framework_TestCase
|
||||
{
|
||||
/**
|
||||
* @access protected
|
||||
*/
|
||||
protected $object;
|
||||
|
||||
/**
|
||||
* Sets up the fixture, for example, opens a network connection.
|
||||
* This method is called before a test is executed.
|
||||
*
|
||||
* @access protected
|
||||
* @return void
|
||||
*/
|
||||
protected function setUp()
|
||||
{
|
||||
$this->object = $this->getMockForAbstractClass('ZipFile');
|
||||
|
||||
}
|
||||
|
||||
/**
|
||||
* Tears down the fixture, for example, closes a network connection.
|
||||
* This method is called after a test is executed.
|
||||
*
|
||||
* @access protected
|
||||
* @return void
|
||||
*/
|
||||
protected function tearDown()
|
||||
{
|
||||
unset($this->object);
|
||||
}
|
||||
|
||||
/**
|
||||
* Test for setDoWrite
|
||||
*/
|
||||
public function testSetDoWrite(){
|
||||
$this->object->setDoWrite();
|
||||
$this->assertTrue($this->object->doWrite);
|
||||
}
|
||||
|
||||
/**
|
||||
* Test for unix2DosTime
|
||||
*
|
||||
* @param $unixtime
|
||||
* @param $output
|
||||
*
|
||||
* @dataProvider providerForTestUnix2DosTime
|
||||
*/
|
||||
public function testUnix2DosTime($unixTime, $output){
|
||||
$this->assertEquals(
|
||||
$this->object->unix2DosTime($unixTime),
|
||||
$output
|
||||
);
|
||||
}
|
||||
|
||||
public function providerForTestUnix2DosTime(){
|
||||
return array(
|
||||
array(
|
||||
123456,
|
||||
2162688
|
||||
),
|
||||
array(
|
||||
234232,
|
||||
2162688
|
||||
),
|
||||
);
|
||||
}
|
||||
|
||||
/**
|
||||
* Test for addFile
|
||||
*/
|
||||
public function testAddFile(){
|
||||
$this->assertEquals(
|
||||
$this->object->addFile('This is test content for the file', 'Test file'),
|
||||
''
|
||||
);
|
||||
$this->assertTrue(!empty($this->object->ctrl_dir));
|
||||
}
|
||||
|
||||
/**
|
||||
* Test for file
|
||||
*/
|
||||
public function testFile(){
|
||||
$file = $this->object->file();
|
||||
$this->assertTrue(
|
||||
!empty($file)
|
||||
);
|
||||
}
|
||||
}
|
||||
Loading…
Reference in New Issue
Block a user