Merge pull request #14502 from owncloud/failing-mysql-master-tests

Failing mysql master tests
This commit is contained in:
Thomas Müller 2015-02-26 01:48:37 -08:00
commit adc986f3e4
6 changed files with 17 additions and 6 deletions

View File

@ -36,7 +36,7 @@ use OC\URLGenerator;
/**
* @package OCA\Files_Sharing\Controllers
*/
class ShareControllerTest extends \PHPUnit_Framework_TestCase {
class ShareControllerTest extends \Test\TestCase {
/** @var IAppContainer */
private $container;

View File

@ -65,7 +65,7 @@ abstract class TestCase extends \Test\TestCase {
// reset backend
\OC_User::clearBackends();
\OC_User::useBackend('database');
\OC_Group::clearBackends();
// clear share hooks
\OC_Hook::clear('OCP\\Share');
@ -130,6 +130,12 @@ abstract class TestCase extends \Test\TestCase {
\OC_User::setUserId('');
Filesystem::tearDown();
// reset backend
\OC_User::clearBackends();
\OC_User::useBackend('database');
\OC_Group::clearBackends();
\OC_Group::useBackend(new \OC_Group_Database());
parent::tearDownAfterClass();
}

View File

@ -59,7 +59,14 @@ class GroupsTest extends TestCase {
$this->assertInstanceOf('OC_OCS_Result', $result);
$this->assertTrue($result->succeeded());
$this->assertEquals(array('users' => $users), $result->getData());
$this->assertEquals(1, sizeof($result->getData()), 'Asserting the result data array only has the "users" key');
$this->assertArrayHasKey('users', $result->getData());
$resultData = $result->getData();
$resultData = $resultData['users'];
sort($users);
sort($resultData);
$this->assertEquals($users, $resultData);
}

View File

@ -106,6 +106,7 @@ class Manager extends PublicEmitter implements IGroupManager {
public function clearBackends() {
$this->backends = array();
$this->cachedGroups = array();
$this->cachedUserGroups = array();
}
/**

View File

@ -11,7 +11,6 @@ namespace Test\OC\Connector\Sabre;
use OC\Files\FileInfo;
use OC\Connector\Sabre\Directory;
use PHPUnit_Framework_TestCase;
class TestDoubleFileView extends \OC\Files\View {

View File

@ -23,8 +23,6 @@ namespace OCA\ObjectStore\Tests\Unit;
use OC\Files\ObjectStore\ObjectStoreStorage;
use OC\Files\ObjectStore\Swift as ObjectStoreToTest;
use PHPUnit_Framework_TestCase;
//class Swift extends PHPUnit_Framework_TestCase {
class Swift extends \Test\Files\Storage\Storage {