diff options
-rw-r--r-- | phpunit.xml | 2 | ||||
-rw-r--r-- | tests/db/DatabaseHelperTest.php | 11 | ||||
-rw-r--r-- | tests/unit/lib/BackgroundJob/ExpireCredentialsTest.php | 8 |
3 files changed, 15 insertions, 6 deletions
diff --git a/phpunit.xml b/phpunit.xml index 81137a1d..cb67e3ce 100644 --- a/phpunit.xml +++ b/phpunit.xml @@ -2,7 +2,7 @@ <testsuites> <testsuite name="unit"> <directory>./tests/unit</directory> - <exclude>./tests/unit/lib/Db</exclude> + <!--<exclude>./tests/unit/lib/Db</exclude>--> </testsuite> </testsuites> <filter> diff --git a/tests/db/DatabaseHelperTest.php b/tests/db/DatabaseHelperTest.php index 87735dfe..fa78158f 100644 --- a/tests/db/DatabaseHelperTest.php +++ b/tests/db/DatabaseHelperTest.php @@ -48,16 +48,21 @@ abstract class DatabaseHelperTest extends PHPUnit_Extensions_Database_TestCase { * @var PHPUnit_Extensions_Database_DataSet_MysqlXmlDataSet[] */ protected $datasets; + + /** + * + * @var \OC\Server + */ + static protected $server = NULL; public function __construct() { parent::__construct(); } public function setUp() { - $server = new \OC\Server(getenv('SERVER_BASE_DIR'), new \OC\Config(getenv('SERVER_CONFIG_DIR'), getenv('SERVER_CONFIG_FILE'))); - $this->app_container = $server->query('passman'); + if (self::$server === NULL) self::$server = new \OC\Server(getenv('SERVER_BASE_DIR'), new \OC\Config(getenv('SERVER_CONFIG_DIR'), getenv('SERVER_CONFIG_FILE'))); - $this->db = $this->app_container->getServer()->getDatabaseConnection(); + $this->db = self::$server->getDatabaseConnection(); $this->datasets = []; $tables = $this->getTablesNames(); diff --git a/tests/unit/lib/BackgroundJob/ExpireCredentialsTest.php b/tests/unit/lib/BackgroundJob/ExpireCredentialsTest.php index a6d193dd..836a3b09 100644 --- a/tests/unit/lib/BackgroundJob/ExpireCredentialsTest.php +++ b/tests/unit/lib/BackgroundJob/ExpireCredentialsTest.php @@ -43,7 +43,11 @@ class ExpireCredentialsTest extends PHPUnit_Framework_TestCase { $jobList = $this->getMockBuilder('\OCP\BackgroundJob\IJobList')->getMock(); /** @var \OC\BackgroundJob\JobList $jobList */ - $backgroundJob->execute($jobList); - $this->assertTrue(true); + try { + $backgroundJob->execute($jobList); + } + catch (Exception $ex) { + $this->assertTrue(false); + } } } |