diff options
author | Robin Appelman <icewind@owncloud.com> | 2015-08-20 14:38:51 +0200 |
---|---|---|
committer | Robin Appelman <icewind@owncloud.com> | 2015-08-20 15:17:14 +0200 |
commit | 3dbfbdaf549f69c63c6e59d91681c7df65789ece (patch) | |
tree | a06ab2d20f1a7834ecf630f41e761d69374edc78 /tests/lib/connector/sabre | |
parent | 67893ca83998753e4c40114846c7169e3e534d74 (diff) | |
download | nextcloud-server-3dbfbdaf549f69c63c6e59d91681c7df65789ece.tar.gz nextcloud-server-3dbfbdaf549f69c63c6e59d91681c7df65789ece.zip |
allow moving common test logic into traits
Diffstat (limited to 'tests/lib/connector/sabre')
-rw-r--r-- | tests/lib/connector/sabre/requesttest/requesttest.php | 17 |
1 files changed, 4 insertions, 13 deletions
diff --git a/tests/lib/connector/sabre/requesttest/requesttest.php b/tests/lib/connector/sabre/requesttest/requesttest.php index c7739aefcd7..7b192824412 100644 --- a/tests/lib/connector/sabre/requesttest/requesttest.php +++ b/tests/lib/connector/sabre/requesttest/requesttest.php @@ -16,12 +16,10 @@ use OC\Files\View; use OCP\IUser; use Sabre\HTTP\Request; use Test\TestCase; +use Test\Traits\UserTrait; abstract class RequestTest extends TestCase { - /** - * @var \OC_User_Dummy - */ - protected $userBackend; + use UserTrait; /** * @var \OCP\Files\Config\IMountProvider[] @@ -65,8 +63,6 @@ abstract class RequestTest extends TestCase { protected function setUp() { parent::setUp(); - $this->userBackend = new \OC_User_Dummy(); - \OC::$server->getUserManager()->registerBackend($this->userBackend); $this->serverFactory = new ServerFactory( \OC::$server->getConfig(), @@ -78,15 +74,10 @@ abstract class RequestTest extends TestCase { ); } - protected function tearDown() { - parent::tearDown(); - \OC::$server->getUserManager()->removeBackend($this->userBackend); - } - protected function setupUser($name, $password) { - $this->userBackend->createUser($name, $password); + $this->createUser($name, $password); \OC::$server->getMountProviderCollection()->registerProvider($this->getMountProvider($name, [ - '/' . $name => new Temporary() + '/' . $name => '\OC\Files\Storage\Temporary' ])); $this->loginAsUser($name); return new View('/' . $name . '/files'); |