]> source.dussan.org Git - nextcloud-server.git/commitdiff
Make root tests extend the \Test\TestCase
authorJoas Schilling <nickvergessen@gmx.de>
Mon, 10 Nov 2014 21:59:50 +0000 (22:59 +0100)
committerJoas Schilling <nickvergessen@gmx.de>
Wed, 19 Nov 2014 13:53:51 +0000 (14:53 +0100)
46 files changed:
tests/lib/activitymanager.php
tests/lib/api.php
tests/lib/app.php
tests/lib/appconfig.php
tests/lib/archive.php
tests/lib/archive/tar.php
tests/lib/archive/zip.php
tests/lib/autoloader.php
tests/lib/avatar.php
tests/lib/cache.php
tests/lib/cache/file.php
tests/lib/cache/usercache.php
tests/lib/config.php
tests/lib/db.php
tests/lib/dbschema.php
tests/lib/errorHandler.php
tests/lib/geo.php
tests/lib/helper.php
tests/lib/httphelper.php
tests/lib/image.php
tests/lib/installer.php
tests/lib/l10n.php
tests/lib/largefilehelper.php
tests/lib/largefilehelpergetfilesize.php
tests/lib/logger.php
tests/lib/mail.php
tests/lib/migrate.php
tests/lib/naturalsort.php
tests/lib/preferences-singleton.php
tests/lib/preferences.php
tests/lib/preview.php
tests/lib/repair.php
tests/lib/request.php
tests/lib/setup.php
tests/lib/streamwrappers.php
tests/lib/tags.php
tests/lib/template.php
tests/lib/templatelayout.php
tests/lib/tempmanager.php
tests/lib/updater.php
tests/lib/urlgenerator.php
tests/lib/user.php
tests/lib/util.php
tests/lib/utilcheckserver.php
tests/lib/vobject.php
tests/settings/controller/mailsettingscontrollertest.php

index f21b82c52c368ed1a6a7d62f7373cdce609fd829..85f8320de09bb23aeab1fb89387afea1cd1b366b 100644 (file)
@@ -8,12 +8,14 @@
  *
 */
 
-class Test_ActivityManager extends PHPUnit_Framework_TestCase {
+class Test_ActivityManager extends \Test\TestCase {
 
        /** @var \OC\ActivityManager */
        private $activityManager;
 
-       public function setUp() {
+       protected function setUp() {
+               parent::setUp();
+
                $this->activityManager = new \OC\ActivityManager();
                $this->activityManager->registerExtension(function() {
                        return new NoOpExtension();
index 0f7d08543ea51a8121d7bbc47e1fa1ce6850e1e5..bf9748a60400b0016f98fe63d9b71944dd6df5b2 100644 (file)
@@ -6,7 +6,7 @@
  * See the COPYING-README file.
  */
 
-class Test_API extends PHPUnit_Framework_TestCase {
+class Test_API extends \Test\TestCase {
 
        // Helps build a response variable
 
index 6ae548759ed27e70030d3cf890b25a9e87ab43bb..23c1a340e03c8995eefeb7d6067342070a9c1211 100644 (file)
@@ -7,7 +7,7 @@
  * See the COPYING-README file.
  */
 
-class Test_App extends PHPUnit_Framework_TestCase {
+class Test_App extends \Test\TestCase {
 
        private $oldAppConfigService;
 
index 9257ae45b0ebe307e891392b436dbbb288a4d163..188721ff92d559b004ce788a4e8844d8ec2f7223 100644 (file)
@@ -7,8 +7,10 @@
  * See the COPYING-README file.
  */
 
-class Test_Appconfig extends PHPUnit_Framework_TestCase {
+class Test_Appconfig extends \Test\TestCase {
        public static function setUpBeforeClass() {
+               parent::setUpBeforeClass();
+
                $query = \OC_DB::prepare('INSERT INTO `*PREFIX*appconfig` VALUES (?, ?, ?)');
 
                $query->execute(array('testapp', 'enabled', 'true'));
@@ -33,6 +35,8 @@ class Test_Appconfig extends PHPUnit_Framework_TestCase {
                $query->execute(array('someapp'));
                $query->execute(array('123456'));
                $query->execute(array('anotherapp'));
+
+               parent::tearDownAfterClass();
        }
 
        public function testGetApps() {
index be5cc897a67b1134f824700080abd21b3edb9b7a..690b4378b88a10dfe9cbe79eb2d07418db2c6fea 100644 (file)
@@ -6,7 +6,7 @@
  * See the COPYING-README file.
  */
 
-abstract class Test_Archive extends PHPUnit_Framework_TestCase {
+abstract class Test_Archive extends \Test\TestCase {
        /**
         * @var OC_Archive
         */
index 99f7fb30e2bca8b84ed6fe1c0151433874b359ab..43157e2054dd608fa9382c17a8fe5c55f906eea8 100644 (file)
@@ -7,11 +7,12 @@
  */
 
 class Test_Archive_TAR extends Test_Archive {
-       public function setUp() {
+       protected function setUp() {
+               parent::setUp();
+
                if (OC_Util::runningOnWindows()) {
                        $this->markTestSkipped('[Windows] tar archives are not supported on Windows');
                }
-               parent::setUp();
        }
 
        protected function getExisting() {
index 90958baf38024a66125aefe8e997766f5cdf7d66..09ea5d7d27c66e57016b0c4f91cace6cfeb2eed3 100644 (file)
@@ -6,8 +6,15 @@
  * See the COPYING-README file.
  */
 
-if (!OC_Util::runningOnWindows()) {
 class Test_Archive_ZIP extends Test_Archive {
+       protected function setUp() {
+               parent::setUp();
+
+               if (OC_Util::runningOnWindows()) {
+                       $this->markTestSkipped('[Windows] ');
+               }
+       }
+
        protected function getExisting() {
                $dir = OC::$SERVERROOT . '/tests/data';
                return new OC_Archive_ZIP($dir . '/data.zip');
@@ -17,4 +24,3 @@ class Test_Archive_ZIP extends Test_Archive {
                return new OC_Archive_ZIP(OCP\Files::tmpFile('.zip'));
        }
 }
-}
index 46172647249f4558c841d4d761dced80624caa32..bf63094a9ef5199cb1149cb74e12f1c670de63b9 100644 (file)
@@ -8,13 +8,14 @@
 
 namespace Test;
 
-class AutoLoader extends \PHPUnit_Framework_TestCase {
+class AutoLoader extends TestCase {
        /**
         * @var \OC\Autoloader $loader
         */
        private $loader;
 
-       public function setUp() {
+       protected function setUp() {
+               parent::setUp();
                $this->loader = new \OC\AutoLoader();
        }
 
index 0334639afa861174282f6b2235a16e0ba18ae6d2..421be155d17bc10e218c3fa58bb9873aabf5244d 100644 (file)
@@ -6,12 +6,14 @@
  * later.
  * See the COPYING-README file.
  */
-class Test_Avatar extends PHPUnit_Framework_TestCase {
+class Test_Avatar extends \Test\TestCase {
 
        private $user;
 
-       public function setUp() {
-               $this->user = uniqid();
+       protected function setUp() {
+               parent::setUp();
+
+               $this->user = $this->getUniqueID();
                $storage = new \OC\Files\Storage\Temporary(array());
                \OC\Files\Filesystem::mount($storage, array(), '/' . $this->user . '/');
        }
index 8fefa25f65d97f55468cd3835b33dd5031d30f3c..bdee0348e500c73b2d705652dc58a7ee4893556c 100644 (file)
@@ -6,16 +6,17 @@
  * See the COPYING-README file.
  */
 
-abstract class Test_Cache extends PHPUnit_Framework_TestCase {
+abstract class Test_Cache extends \Test\TestCase {
        /**
         * @var \OC\Cache cache;
         */
        protected $instance;
 
-       public function tearDown() {
+       protected function tearDown() {
                if($this->instance) {
                        $this->instance->clear();
                }
+               parent::tearDown();
        }
 
        function testSimple() {
index 8cc45c85405d7b11da2cda6470b26f1258a7f8ee..d51322036c8789566790c94d0e5dc9e983b67a59 100644 (file)
@@ -33,8 +33,10 @@ class FileCache extends \Test_Cache {
        function skip() {
                //$this->skipUnless(OC_User::isLoggedIn());
        }
-       
-       public function setUp() {
+
+       protected function setUp() {
+               parent::setUp();
+
                //clear all proxies and hooks so we can do clean testing
                \OC_FileProxy::clearProxies();
                \OC_Hook::clear('OC_Filesystem');
@@ -70,7 +72,7 @@ class FileCache extends \Test_Cache {
                $this->instance=new \OC\Cache\File();
        }
 
-       public function tearDown() {
+       protected function tearDown() {
                \OC_User::setUserId($this->user);
                \OC_Config::setValue('cachedirectory', $this->datadir);
 
index 8a23a805ebeea852c76e4824990934e40965f91d..3822a714d5a5135082f71bc392ca5e0c463c884d 100644 (file)
@@ -30,7 +30,9 @@ class UserCache extends \Test_Cache {
        /** @var \OC\Files\Storage\Storage */
        private $storage;
 
-       public function setUp() {
+       protected function setUp() {
+               parent::setUp();
+
                //clear all proxies and hooks so we can do clean testing
                \OC_FileProxy::clearProxies();
                \OC_Hook::clear('OC_Filesystem');
@@ -66,7 +68,7 @@ class UserCache extends \Test_Cache {
                $this->instance=new \OC\Cache\UserCache();
        }
 
-       public function tearDown() {
+       protected function tearDown() {
                \OC_User::setUserId($this->user);
                \OC_Config::setValue('cachedirectory', $this->datadir);
 
index 180f6b1649b04e72f6c800266e40e49ec1f1d2f8..9dff3aab84f9bfc335deb2a2d3443532509d9003 100644 (file)
@@ -6,7 +6,7 @@
  * See the COPYING-README file.
  */
 
-class Test_Config extends PHPUnit_Framework_TestCase {
+class Test_Config extends \Test\TestCase {
        const TESTCONTENT = '<?php $CONFIG=array("foo"=>"bar", "beers" => array("Appenzeller", "Guinness", "Kölsch"), "alcohol_free" => false);';
 
        /** @var array */
@@ -18,15 +18,18 @@ class Test_Config extends PHPUnit_Framework_TestCase {
        /** @var string */
        private $randomTmpDir;
 
-       function setUp() {
+       protected function setUp() {
+               parent::setUp();
+
                $this->randomTmpDir = \OC_Helper::tmpFolder();
                $this->configFile = $this->randomTmpDir.'testconfig.php';
                file_put_contents($this->configFile, self::TESTCONTENT);
                $this->config = new OC\Config($this->randomTmpDir, 'testconfig.php');
        }
 
-       public function tearDown() {
+       protected function tearDown() {
                unlink($this->configFile);
+               parent::tearDown();
        }
 
        public function testGetKeys() {
index fb673b8092b88e874b7148c1235fe7aefd0ec2ff..a401aded62a0e33bc7e83d011eead4ced4e82f8a 100644 (file)
@@ -6,7 +6,7 @@
  * See the COPYING-README file.
  */
 
-class Test_DB extends PHPUnit_Framework_TestCase {
+class Test_DB extends \Test\TestCase {
        protected $backupGlobals = FALSE;
 
        protected static $schema_file = 'static://test_db_scheme';
@@ -32,7 +32,9 @@ class Test_DB extends PHPUnit_Framework_TestCase {
         */
        private $table4;
 
-       public function setUp() {
+       protected function setUp() {
+               parent::setUp();
+
                $dbfile = OC::$SERVERROOT.'/tests/data/db_structure.xml';
 
                $r = '_'.OC_Util::generateRandomBytes(4).'_';
@@ -48,9 +50,11 @@ class Test_DB extends PHPUnit_Framework_TestCase {
                $this->table4 = $this->test_prefix.'decimal';
        }
 
-       public function tearDown() {
+       protected function tearDown() {
                OC_DB::removeDBStructure(self::$schema_file);
                unlink(self::$schema_file);
+
+               parent::tearDown();
        }
 
        public function testQuotes() {
index d31bd34124e53b134ab957b148ffdc2fc188065e..cfaebec079ee44d5b4c8830ceb05cc0c53a30424 100644 (file)
@@ -9,13 +9,15 @@
 
 use OCP\Security\ISecureRandom;
 
-class Test_DBSchema extends PHPUnit_Framework_TestCase {
+class Test_DBSchema extends \Test\TestCase {
        protected $schema_file = 'static://test_db_scheme';
        protected $schema_file2 = 'static://test_db_scheme2';
        protected $table1;
        protected $table2;
 
-       public function setUp() {
+       protected function setUp() {
+               parent::setUp();
+
                $dbfile = OC::$SERVERROOT.'/tests/data/db_structure.xml';
                $dbfile2 = OC::$SERVERROOT.'/tests/data/db_structure2.xml';
 
@@ -32,9 +34,11 @@ class Test_DBSchema extends PHPUnit_Framework_TestCase {
                $this->table2 = $r.'cntcts_cards';
        }
 
-       public function tearDown() {
+       protected function tearDown() {
                unlink($this->schema_file);
                unlink($this->schema_file2);
+
+               parent::tearDown();
        }
 
        // everything in one test, they depend on each other
index 58db80b3c6efbcd85f3fc08b04e005a2c35ac8e8..726529e83f4dece236b8a7bb670fb94bb1a39e84 100644 (file)
@@ -20,7 +20,7 @@
  *
  */
 
-class Test_ErrorHandler extends \PHPUnit_Framework_TestCase {
+class Test_ErrorHandler extends \Test\TestCase {
 
        /**
         * provide username, password combinations for testRemovePassword
index 1c56a976129fdb67810643cdc3745e3365d4871f..0678297b55ac2a4629362e58e96d1738e9cb801c 100644 (file)
@@ -6,7 +6,7 @@
  * See the COPYING-README file.
  */
 
-class Test_Geo extends PHPUnit_Framework_TestCase {
+class Test_Geo extends \Test\TestCase {
        
        /**
         * @medium
index 57c72c11987bf7af3650c9b241215e144f12fa6c..53a3e1a0ec82c86934d07b2ebc00b36bfe865288 100644 (file)
@@ -6,7 +6,7 @@
  * See the COPYING-README file.
  */
 
-class Test_Helper extends PHPUnit_Framework_TestCase {
+class Test_Helper extends \Test\TestCase {
 
        /**
         * @dataProvider humanFileSizeProvider
index 191200aee3d492219efda30d026fdbab2be7dd0f..34dee35fe0295db1bcb5357251f14a8e21dcb4a5 100644 (file)
@@ -6,14 +6,16 @@
  * See the COPYING-README file.
  */
 
-class TestHTTPHelper extends \PHPUnit_Framework_TestCase {
+class TestHTTPHelper extends \Test\TestCase {
 
        /** @var \OC\AllConfig*/
        private $config;
        /** @var \OC\HTTPHelper */
        private $httpHelperMock;
 
-       function setUp() {
+       protected function setUp() {
+               parent::setUp();
+
                $this->config = $this->getMockBuilder('\OC\AllConfig')
                        ->disableOriginalConstructor()->getMock();
                $this->httpHelperMock = $this->getMockBuilder('\OC\HTTPHelper')
index a683c3d2c8b674b66f93dd639249fe1248adb310..e0009b9710ebf260f2c7de09e52f8aa6641436be 100644 (file)
@@ -6,10 +6,12 @@
  * See the COPYING-README file.
  */
 
-class Test_Image extends PHPUnit_Framework_TestCase {
+class Test_Image extends \Test\TestCase {
        public static function tearDownAfterClass() {
                @unlink(OC::$SERVERROOT.'/tests/data/testimage2.png');
                @unlink(OC::$SERVERROOT.'/tests/data/testimage2.jpg');
+
+               parent::tearDownAfterClass();
        }
 
        public function testGetMimeTypeForFile() {
index 5e267245200eb6204b4439491eab2e212a17722f..b58a71b5a08d64e564c07dfb6307d9f9f96e1c37 100644 (file)
@@ -6,20 +6,24 @@
  * See the COPYING-README file.
  */
 
-class Test_Installer extends PHPUnit_Framework_TestCase {
+class Test_Installer extends \Test\TestCase {
 
        private static $appid = 'testapp';
        private $appstore;
 
-       public function setUp() {
+       protected function setUp() {
+               parent::setUp();
+
                $this->appstore = OC_Config::getValue('appstoreenabled', true);
                OC_Config::setValue('appstoreenabled', true);
                OC_Installer::removeApp(self::$appid);
        }
 
-       public function tearDown() {
+       protected function tearDown() {
                OC_Installer::removeApp(self::$appid);
                OC_Config::setValue('appstoreenabled', $this->appstore);
+
+               parent::tearDown();
        }
 
        public function testInstallApp() {
index df86fcfda81abf0cf752e27c88d2f92646afd5f3..68f43b76f518348f95db2e38cec9de63065e0bab 100644 (file)
@@ -6,7 +6,7 @@
  * See the COPYING-README file.
  */
 
-class Test_L10n extends PHPUnit_Framework_TestCase {
+class Test_L10n extends \Test\TestCase {
 
        public function testGermanPluralTranslations() {
                $l = new OC_L10N('test');
index 5db1f9c5a74bbd5f077423059c6cd9b0ffad07af..1267a8c5833901c524148932261ae922a6fd292a 100644 (file)
@@ -8,10 +8,10 @@
 
 namespace Test;
 
-class LargeFileHelper extends \PHPUnit_Framework_TestCase {
+class LargeFileHelper extends TestCase {
        protected $helper;
 
-       public function setUp() {
+       protected function setUp() {
                parent::setUp();
                $this->helper = new \OC\LargeFileHelper;
        }
index 90ecc3dde708d51cc75506aa6e8529af28344c89..c97b7b32b0faae8cba3904f78fdc6e7bd33e3f7f 100644 (file)
@@ -12,11 +12,11 @@ namespace Test;
 * Tests whether LargeFileHelper is able to determine file size at all.
 * Large files are not considered yet.
 */
-class LargeFileHelperGetFileSize extends \PHPUnit_Framework_TestCase {
+class LargeFileHelperGetFileSize extends TestCase {
        /** @var \OC\LargeFileHelper */
        protected $helper;
 
-       public function setUp() {
+       protected function setUp() {
                parent::setUp();
                $this->helper = new \OC\LargeFileHelper();
        }
index fcdf5b586706d5117b316ee28b71b6cbd549e69d..700a847917b9baea1cb697a1fd208211bd2d99d4 100644 (file)
@@ -10,14 +10,16 @@ namespace Test;
 
 use OC\Log;
 
-class Logger extends \PHPUnit_Framework_TestCase {
+class Logger extends TestCase {
        /**
         * @var \OCP\ILogger
         */
        private $logger;
        static private $logs = array();
 
-       public function setUp() {
+       protected function setUp() {
+               parent::setUp();
+
                self::$logs = array();
                $this->logger = new Log('Test\Logger');
        }
index 3cc9868e25e876fb48be8cd7afc0123f5ab730a1..568ecff52b0636189d0c0aa09ea0cef4d8e5480b 100644 (file)
@@ -6,10 +6,12 @@
  * See the COPYING-README file.
  */
 
-class Test_Mail extends PHPUnit_Framework_TestCase {
+class Test_Mail extends \Test\TestCase {
 
        protected function setUp()
        {
+               parent::setUp();
+
                if (!function_exists('idn_to_ascii')) {
                        $this->markTestSkipped(
                                'The intl extension is not available.'
index 3f87bbc1ac8b83e4c6c7035cae25aaa74b87a92a..9c1e980c445189f01e9fc66af22fb73db69fbe71 100644 (file)
@@ -6,7 +6,7 @@
  * See the COPYING-README file.
  */
 
-class Test_Migrate extends PHPUnit_Framework_TestCase {
+class Test_Migrate extends \Test\TestCase {
 
        public $users;
        public $tmpfiles = array();
@@ -38,7 +38,7 @@ class Test_Migrate extends PHPUnit_Framework_TestCase {
         * @return string the test users id
         */
        public function generateUser() {
-               $username = uniqid();
+               $username = $this->getUniqueID();
                \OC_User::createUser($username, 'password');
                \OC_Util::tearDownFS();
                \OC_User::setUserId('');
index 09a0e6a5f9d7454555917a9b8b57358399e197ac..e022a85530918078264a7dc4fed476593edce3d0 100644 (file)
@@ -6,9 +6,11 @@
  * See the COPYING-README file.
  */
 
-class Test_NaturalSort extends PHPUnit_Framework_TestCase {
+class Test_NaturalSort extends \Test\TestCase {
 
        public function setUp() {
+               parent::setUp();
+
                if(!class_exists('Collator')) {
                        $this->markTestSkipped('The intl module is not available, natural sorting will not work as expected.');
                        return;
index 7abf5a6be3618160b83756f741c7239dcedaddb9..01e15acdfe109d52492670eb889a83baef937557 100644 (file)
@@ -7,8 +7,10 @@
  * See the COPYING-README file.
  */
 
-class Test_Preferences extends PHPUnit_Framework_TestCase {
+class Test_Preferences extends \Test\TestCase {
        public static function setUpBeforeClass() {
+               parent::setUpBeforeClass();
+
                $query = \OC_DB::prepare('INSERT INTO `*PREFIX*preferences` VALUES(?, ?, ?, ?)');
                $query->execute(array("Someuser", "someapp", "somekey", "somevalue"));
 
@@ -34,6 +36,8 @@ class Test_Preferences extends PHPUnit_Framework_TestCase {
                $query->execute(array('Someuser'));
                $query->execute(array('Anotheruser'));
                $query->execute(array('Anuser'));
+
+               parent::tearDownAfterClass();
        }
 
        public function testGetUsers() {
index fe8e3e8b48c3ddd33816c3369c52622d1516161e..193b1f8028020bad4cb6ea769b56edfbe9bbff44 100644 (file)
@@ -7,7 +7,7 @@
  * See the COPYING-README file.
  */
 
-class Test_Preferences_Object extends PHPUnit_Framework_TestCase {
+class Test_Preferences_Object extends \Test\TestCase {
        public function testGetUsers()
        {
                $statementMock = $this->getMock('\Doctrine\DBAL\Statement', array(), array(), '', false);
index 288dd2aa417505ce36f1634d83851cbb3ec5c22f..2a6761403f452bf21b80ffef9c230f8e78b1bdbb 100644 (file)
@@ -8,7 +8,7 @@
 
 namespace Test;
 
-class Preview extends \Test\TestCase {
+class Preview extends TestCase {
 
        /**
         * @var string
index 121f41dedd92625aa4f496390eb3b61e0bac24c9..248db382140cec371511b928f34bd39490546f93 100644 (file)
@@ -29,7 +29,7 @@ class TestRepairStep extends BasicEmitter implements \OC\RepairStep{
        }
 }
 
-class Test_Repair extends PHPUnit_Framework_TestCase {
+class Test_Repair extends \Test\TestCase {
        public function testRunRepairStep() {
                $output = array();
 
index b89bf92ece7246c1eee51683c4205d6a712468d0..fbab8645d721a8cf82f65be903b4a612662b2ed4 100644 (file)
@@ -6,19 +6,23 @@
  * See the COPYING-README file.
  */
 
-class Test_Request extends PHPUnit_Framework_TestCase {
+class Test_Request extends \Test\TestCase {
+
+       protected function setUp() {
+               parent::setUp();
 
-       public function setUp() {
                OC::$server->getConfig()->setSystemValue('overwritewebroot', '/domain.tld/ownCloud');
 
                OC::$server->getConfig()->setSystemValue('trusted_proxies', array());
                OC::$server->getConfig()->setSystemValue('forwarded_for_headers', array());
        }
 
-       public function tearDown() {
+       protected function tearDown() {
                OC::$server->getConfig()->setSystemValue('overwritewebroot', '');
                OC::$server->getConfig()->setSystemValue('trusted_proxies', array());
                OC::$server->getConfig()->setSystemValue('forwarded_for_headers', array());
+
+               parent::tearDown();
        }
 
        public function testScriptNameOverWrite() {
index 2c1569dd8004b757e150bb9edd7517f0038986ed..8373ba316d695e8ee18ad7f014922c6ccca0e75a 100644 (file)
@@ -8,14 +8,16 @@
 
 use OCP\IConfig;
 
-class Test_OC_Setup extends PHPUnit_Framework_TestCase {
+class Test_OC_Setup extends \Test\TestCase {
 
        /** @var IConfig */
        protected $config;
        /** @var \OC_Setup */
        protected $setupClass;
 
-       public function setUp() {
+       protected function setUp() {
+               parent::setUp();
+
                $this->config = $this->getMock('\OCP\IConfig');
                $this->setupClass = $this->getMock('\OC_Setup', array('class_exists', 'is_callable'), array($this->config));
        }
index 6f92f4870374be5b40223a14a3967dfc9ac8b36c..9a3b6bc9266908ed251a7d0a2ef6b574bdf2a0ef 100644 (file)
@@ -20,7 +20,7 @@
  *
  */
 
-class Test_StreamWrappers extends PHPUnit_Framework_TestCase {
+class Test_StreamWrappers extends \Test\TestCase {
        public function testFakeDir() {
                $items = array('foo', 'bar');
                \OC\Files\Stream\Dir::register('test', $items);
index 57b64f1cd3686a838d260c5aabba79edb4aaf300..ab714bde3dfef23fff7483cc8fb0b35f9ac00e97 100644 (file)
 *
 */
 
-class Test_Tags extends PHPUnit_Framework_TestCase {
+class Test_Tags extends \Test\TestCase {
 
        protected $objectType;
        protected $user;
        protected $backupGlobals = FALSE;
 
-       public function setUp() {
+       protected function setUp() {
+               parent::setUp();
 
                OC_User::clearBackends();
                OC_User::useBackend('dummy');
@@ -39,9 +40,11 @@ class Test_Tags extends PHPUnit_Framework_TestCase {
 
        }
 
-       public function tearDown() {
+       protected function tearDown() {
                //$query = OC_DB::prepare('DELETE FROM `*PREFIX*vcategories` WHERE `item_type` = ?');
                //$query->execute(array('test'));
+
+               parent::tearDown();
        }
 
        public function testInstantiateWithDefaults() {
index 819d592aacfb9235f2099a37d7cbb61c47345349..d77284a5bf263800ef9a0dd420d491b31d44a9f2 100644 (file)
 *
 */
 
-class Test_TemplateFunctions extends PHPUnit_Framework_TestCase {
+class Test_TemplateFunctions extends \Test\TestCase {
+
+       protected function setUp() {
+               parent::setUp();
 
-       public function setUp() {
                $loader = new \OC\Autoloader();
                $loader->load('OC_Template');
        }
index 0335c7c88ee0800f8046085167af2ef609160316..1035dae122d90b966e5706c5d550c1ea2ab89411 100644 (file)
@@ -11,23 +11,27 @@ namespace OC\Test;
 /**
  * @package OC\Test
  */
-class OC_TemplateLayout extends \PHPUnit_Framework_TestCase {
+class OC_TemplateLayout extends \Test\TestCase {
 
-       private $oldServerUri;
+       private $oldServerURI;
        private $oldScriptName;
 
-       public function setUp() {
+       protected function setUp() {
+               parent::setUp();
+
                $this->oldServerURI = isset($_SERVER['REQUEST_URI']) ? $_SERVER['REQUEST_URI'] : null;
                $this->oldScriptName = $_SERVER['SCRIPT_NAME'];
        }
 
-       public function tearDown() {
+       protected function tearDown() {
                if ($this->oldServerURI === null) {
                        unset($_SERVER['REQUEST_URI']);
                } else {
                        $_SERVER['REQUEST_URI'] = $this->oldServerURI;
                }
                $_SERVER['SCRIPT_NAME'] = $this->oldScriptName;
+
+               parent::tearDown();
        }
 
        /**
index 85b94094393e0897a5150cf934f2fa8a2568b639..05311e820a7ed85da50a83a723311264dc881a28 100644 (file)
@@ -21,18 +21,21 @@ class NullLogger extends Log {
        }
 }
 
-class TempManager extends \PHPUnit_Framework_TestCase {
+class TempManager extends \Test\TestCase {
        protected $baseDir;
 
-       public function setUp() {
+       protected function setUp() {
+               parent::setUp();
+
                $this->baseDir = get_temp_dir() . '/oc_tmp_test';
                if (!is_dir($this->baseDir)) {
                        mkdir($this->baseDir);
                }
        }
 
-       public function tearDown() {
+       protected function tearDown() {
                \OC_Helper::rmdirr($this->baseDir);
+               parent::tearDown();
        }
 
        /**
index 4488744fa1ded3ac138948375cb8418253ecdf35..cc82450cfb6125beec240e5f0681c81dbc8309d7 100644 (file)
@@ -8,7 +8,7 @@
 
 namespace OC;
 
-class UpdaterTest extends \PHPUnit_Framework_TestCase {
+class UpdaterTest extends \Test\TestCase {
 
        public function testVersionCompatbility() {
                return array(
index 066272731ee207b0c1c47a8102cf71e02a378f63..a92aaddeb4c6048019a790d6e0b8c9560b0907c6 100644 (file)
@@ -6,7 +6,7 @@
  * See the COPYING-README file.
  */
 
-class Test_Urlgenerator extends PHPUnit_Framework_TestCase {
+class Test_Urlgenerator extends \Test\TestCase {
 
        /**
         * @small
index e2c3282a19f4181e68ff5f92d8ac9969f34891be..cb0c661b2a489862789bc31214107b7817698f7d 100644 (file)
@@ -9,13 +9,15 @@
 
 namespace Test;
 
-class User extends \PHPUnit_Framework_TestCase {
+class User extends TestCase {
        /**
         * @var \OC_User_Backend | \PHPUnit_Framework_MockObject_MockObject $backend
         */
        private $backend;
        
        protected function setUp(){
+               parent::setUp();
+
                $this->backend = $this->getMock('\OC_User_Dummy');
                $manager = \OC_User::getManager();
                $manager->registerBackend($this->backend);
index 9a3185b3f792926909845143e830a2f95db262b0..6de599b070ede1c190d9ccd9de4c5658d195c0a0 100644 (file)
@@ -6,7 +6,7 @@
  * See the COPYING-README file.
  */
 
-class Test_Util extends PHPUnit_Framework_TestCase {
+class Test_Util extends \Test\TestCase {
        public function testGetVersion() {
                $version = \OC_Util::getVersion();
                $this->assertTrue(is_array($version));
index 73a1d0e95a6d3dbb0e25e363b8cad655c0fa5928..bb9b7a244528722057e4215e29a0c291de0eb593 100644 (file)
@@ -9,7 +9,7 @@
 /**
  * Tests for server check functions
  */
-class Test_Util_CheckServer extends PHPUnit_Framework_TestCase {
+class Test_Util_CheckServer extends \Test\TestCase {
 
        private $datadir;
 
@@ -32,16 +32,19 @@ class Test_Util_CheckServer extends PHPUnit_Framework_TestCase {
                return $config;
        }
 
-       public function setUp() {
+       protected function setUp() {
+               parent::setUp();
+
                $this->datadir = \OC_Helper::tmpFolder();
 
                file_put_contents($this->datadir . '/.ocdata', '');
                \OC::$server->getSession()->set('checkServer_succeeded', false);
        }
 
-       public function tearDown() {
+       protected function tearDown() {
                // clean up
                @unlink($this->datadir . '/.ocdata');
+               parent::tearDown();
        }
 
        /**
index db5b0f99f06351076ea31d64ef1959095ad7f883..6fabf30e48f04a7d3c0731865c46e1ae3fce5eb9 100644 (file)
@@ -6,9 +6,11 @@
  * See the COPYING-README file.
  */
 
-class Test_VObject extends PHPUnit_Framework_TestCase {
+class Test_VObject extends \Test\TestCase {
+
+       protected function setUp() {
+               parent::setUp();
 
-       public function setUp() {
                Sabre\VObject\Property::$classMap['SUMMARY'] = 'OC\VObject\StringProperty';
                Sabre\VObject\Property::$classMap['ORG'] = 'OC\VObject\CompoundProperty';
        }
index 789b6ce8fb038cbdcdd1c97bd8a387e327fd58de..f6ebade7b171740075cd0b0972eca87a322099b1 100644 (file)
@@ -14,11 +14,13 @@ use \OC\Settings\Application;
 /**
  * @package OC\Settings\Controller
  */
-class MailSettingsControllerTest extends \PHPUnit_Framework_TestCase {
+class MailSettingsControllerTest extends \Test\TestCase {
 
        private $container;
 
        protected function setUp() {
+               parent::setUp();
+
                $app = new Application();
                $this->container = $app->getContainer();
                $this->container['Config'] = $this->getMockBuilder('\OCP\IConfig')