[files] fix mock creation and remove hardcoded 'require' statement
This commit is contained in:
parent
b777c0fd75
commit
e2bd32323d
|
@ -21,8 +21,6 @@
|
||||||
*
|
*
|
||||||
*/
|
*/
|
||||||
|
|
||||||
require_once realpath( dirname(__FILE__).'/../lib/app.php' );
|
|
||||||
|
|
||||||
OCP\JSON::checkLoggedIn();
|
OCP\JSON::checkLoggedIn();
|
||||||
OCP\JSON::callCheck();
|
OCP\JSON::callCheck();
|
||||||
|
|
||||||
|
|
|
@ -21,18 +21,15 @@
|
||||||
*
|
*
|
||||||
*/
|
*/
|
||||||
|
|
||||||
|
|
||||||
require_once dirname(__FILE__).'/../lib/app.php';
|
|
||||||
|
|
||||||
class Test_OC_Files_App_Rename extends \PHPUnit_Framework_TestCase {
|
class Test_OC_Files_App_Rename extends \PHPUnit_Framework_TestCase {
|
||||||
|
|
||||||
function setUp() {
|
function setUp() {
|
||||||
// mock OC_L10n
|
// mock OC_L10n
|
||||||
$l10nMock = $this->getMock('\OC_L10N', array('t'));
|
$l10nMock = $this->getMock('\OC_L10N', array('t'), array(), '', false);
|
||||||
$l10nMock->expects($this->any())
|
$l10nMock->expects($this->any())
|
||||||
->method('t')
|
->method('t')
|
||||||
->will($this->returnArgument(0));
|
->will($this->returnArgument(0));
|
||||||
$viewMock = $this->getMock('\OC\Files\View', array('rename', 'normalizePath'));
|
$viewMock = $this->getMock('\OC\Files\View', array('rename', 'normalizePath'), array(), '', false);
|
||||||
$viewMock->expects($this->any())
|
$viewMock->expects($this->any())
|
||||||
->method('normalizePath')
|
->method('normalizePath')
|
||||||
->will($this->returnArgument(0));
|
->will($this->returnArgument(0));
|
||||||
|
|
Loading…
Reference in New Issue