mirror of
https://github.com/nextcloud/server.git
synced 2026-06-14 19:20:35 -04:00
Deduplicate data provider and fix method visibility
This commit is contained in:
parent
1592be117a
commit
781cfff221
2 changed files with 15 additions and 19 deletions
|
|
@ -52,7 +52,7 @@ class UpdateTest extends TestCase {
|
|||
/** @var \OC\Encryption\File | \PHPUnit_Framework_MockObject_MockObject */
|
||||
private $fileHelper;
|
||||
|
||||
public function setUp() {
|
||||
protected function setUp() {
|
||||
parent::setUp();
|
||||
|
||||
$this->view = $this->getMockBuilder('\OC\Files\View')
|
||||
|
|
|
|||
|
|
@ -44,7 +44,7 @@ class Encryption extends \Test\Files\Storage\Storage {
|
|||
*/
|
||||
private $update;
|
||||
|
||||
public function setUp() {
|
||||
protected function setUp() {
|
||||
|
||||
parent::setUp();
|
||||
|
||||
|
|
@ -127,7 +127,7 @@ class Encryption extends \Test\Files\Storage\Storage {
|
|||
}
|
||||
|
||||
/**
|
||||
* @dataProvider dataTestRename
|
||||
* @dataProvider dataTestCopyAndRename
|
||||
*
|
||||
* @param string $source
|
||||
* @param string $target
|
||||
|
|
@ -154,25 +154,13 @@ class Encryption extends \Test\Files\Storage\Storage {
|
|||
}
|
||||
|
||||
/**
|
||||
* data provider for testRename()
|
||||
*
|
||||
* @return array
|
||||
*/
|
||||
public function dataTestRename() {
|
||||
return array(
|
||||
array('source', 'target', false),
|
||||
array('source', '/subFolder/target', true),
|
||||
);
|
||||
}
|
||||
|
||||
/**
|
||||
* @dataProvider dataTestCopy
|
||||
* @dataProvider dataTestCopyAndRename
|
||||
*
|
||||
* @param string $source
|
||||
* @param string $target
|
||||
* @param boolean $shouldUpdate
|
||||
*/
|
||||
public function testCopy($source, $target, $shouldUpdate) {
|
||||
public function testCopyTesting($source, $target, $shouldUpdate) {
|
||||
$this->keyStore
|
||||
->expects($this->once())
|
||||
->method('copyKeys')
|
||||
|
|
@ -193,12 +181,20 @@ class Encryption extends \Test\Files\Storage\Storage {
|
|||
}
|
||||
|
||||
/**
|
||||
* data provider for testRename()
|
||||
* @dataProvider copyAndMoveProvider
|
||||
*/
|
||||
public function testCopy($source, $target) {
|
||||
$this->assertTrue(true, 'Replaced by testCopyTesting()');
|
||||
}
|
||||
|
||||
/**
|
||||
* data provider for testCopyTesting() and dataTestCopyAndRename()
|
||||
*
|
||||
* @return array
|
||||
*/
|
||||
public function dataTestCopy() {
|
||||
public function dataTestCopyAndRename() {
|
||||
return array(
|
||||
array('source', 'target', false),
|
||||
array('source', 'target', false),
|
||||
array('source', '/subFolder/target', true),
|
||||
);
|
||||
|
|
|
|||
Loading…
Reference in a new issue