Skip to content
This repository has been archived by the owner on Nov 14, 2018. It is now read-only.

Commit

Permalink
Make all tests extend the new \Test\TestCase
Browse files Browse the repository at this point in the history
  • Loading branch information
nickvergessen committed Nov 17, 2014
1 parent 9a7f871 commit b9c004d
Show file tree
Hide file tree
Showing 6 changed files with 27 additions and 14 deletions.
13 changes: 9 additions & 4 deletions files_archive/tests/storage.php
Original file line number Diff line number Diff line change
Expand Up @@ -16,13 +16,16 @@ class Archive_Zip extends Storage {
*/
private $tmpFile;

public function setUp() {
protected function setUp() {
parent::setUp();

$this->tmpFile=\OCP\Files::tmpFile('.zip');
$this->instance=new \OC\Files\Storage\Archive(array('archive'=>$this->tmpFile));
}

public function tearDown() {
protected function tearDown() {
unlink($this->tmpFile);
parent::tearDown();
}
}

Expand All @@ -32,12 +35,14 @@ class Archive_Tar extends Storage {
*/
private $tmpFile;

public function setUp() {
protected function setUp() {
parent::setUp();
$this->tmpFile=\OCP\Files::tmpFile('.tar.gz');
$this->instance=new \OC\Files\Storage\Archive(array('archive'=>$this->tmpFile));
}

public function tearDown() {
protected function tearDown() {
unlink($this->tmpFile);
parent::tearDown();
}
}
5 changes: 3 additions & 2 deletions files_locking/tests/LockTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -14,14 +14,15 @@

use OCA\Files_Locking\Lock;

class LockTest extends \PHPUnit_Framework_TestCase {
class LockTest extends \Test\TestCase {
/**
* @var Lock
*/
private $fileLock;

protected function setup() {
parent::setUp();

public function setup() {
\OCP\App::checkAppEnabled('files_locking');
$this->fileLock = new Lock(__DIR__ . '/data/test.txt');
}
Expand Down
6 changes: 4 additions & 2 deletions files_locking/tests/LockingWrapperTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@
use OCA\Files_Locking\LockingWrapper;
use OCP\App;

class LockingWrapperTest extends \PHPUnit_Framework_TestCase {
class LockingWrapperTest extends \Test\TestCase {

/**
* @var OC_User
Expand All @@ -33,7 +33,9 @@ class LockingWrapperTest extends \PHPUnit_Framework_TestCase {
*/
private $fileLocker;

public function setup() {
protected function setup() {
parent::setUp();

App::checkAppEnabled('files_locking');
OC_User::clearBackends();
OC_User::useBackend(new OC_User_Dummy());
Expand Down
5 changes: 3 additions & 2 deletions user_external/tests/ftp.php
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
* See the COPYING-README file.
*/

class Test_User_FTP extends PHPUnit_Framework_TestCase{
class Test_User_FTP extends \Test\TestCase {
/**
* @var OC_User_IMAP $instance
*/
Expand All @@ -21,7 +21,8 @@ function skip() {
$this->skipUnless($config['ftp']['run']);
}

function setUp() {
protected function setUp() {
parent::setUp();
$config=$this->getConfig();
$this->instance=new OC_User_FTP($config['ftp']['host']);
}
Expand Down
6 changes: 4 additions & 2 deletions user_external/tests/imap.php
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
* See the COPYING-README file.
*/

class Test_User_Imap extends PHPUnit_Framework_TestCase{
class Test_User_Imap extends \Test\TestCase {
/**
* @var OC_User_IMAP $instance
*/
Expand All @@ -21,7 +21,9 @@ function skip() {
$this->skipUnless($config['imap']['run']);
}

function setUp() {
protected function setUp() {
parent::setUp();

$config=$this->getConfig();
$this->instance=new OC_User_IMAP($config['imap']['mailbox']);
}
Expand Down
6 changes: 4 additions & 2 deletions user_external/tests/smb.php
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
* See the COPYING-README file.
*/

class Test_User_SMB extends PHPUnit_Framework_TestCase{
class Test_User_SMB extends \Test\TestCase {
/**
* @var OC_User_IMAP $instance
*/
Expand All @@ -21,7 +21,9 @@ function skip() {
$this->skipUnless($config['smb']['run']);
}

function setUp() {
protected function setUp() {
parent::setUp();

$config=$this->getConfig();
$this->instance=new OC_User_SMB($config['smb']['host']);
}
Expand Down

0 comments on commit b9c004d

Please sign in to comment.