[Pkg-owncloud-commits] [owncloud] 29/90: and don't forget to adjust tests
David Prévot
taffit at moszumanska.debian.org
Fri Feb 6 21:10:45 UTC 2015
This is an automated email from the git hooks/post-receive script.
taffit pushed a commit to branch master
in repository owncloud.
commit dd18f963d42fd1ce0c9f553a367ae7c42b122782
Author: Arthur Schiwon <blizzz at owncloud.com>
Date: Thu Dec 18 12:22:34 2014 +0100
and don't forget to adjust tests
---
apps/user_ldap/tests/jobs/cleanup.php | 33 ++++++++++++---------------------
1 file changed, 12 insertions(+), 21 deletions(-)
diff --git a/apps/user_ldap/tests/jobs/cleanup.php b/apps/user_ldap/tests/jobs/cleanup.php
index 687f7e1..3aa9a4a 100644
--- a/apps/user_ldap/tests/jobs/cleanup.php
+++ b/apps/user_ldap/tests/jobs/cleanup.php
@@ -27,12 +27,9 @@ class Test_CleanUp extends \PHPUnit_Framework_TestCase {
*/
public function test_runNotAllowedByDisabledConfigurations() {
$args = $this->getMocks();
- $args['helper']->expects($this->exactly(2))
- ->method('getServerConfigurationPrefixes')
- ->will($this->onConsecutiveCalls(
- array_pad(array(), 4, true),
- array_pad(array(), 3, true))
- );
+ $args['helper']->expects($this->once())
+ ->method('haveDisabledConfigurations')
+ ->will($this->returnValue(true) );
$args['ocConfig']->expects($this->never())
->method('getSystemValue');
@@ -50,9 +47,9 @@ class Test_CleanUp extends \PHPUnit_Framework_TestCase {
*/
public function test_runNotAllowedByBrokenHelper() {
$args = $this->getMocks();
- $args['helper']->expects($this->exactly(2))
- ->method('getServerConfigurationPrefixes')
- ->will($this->returnValue(null) );
+ $args['helper']->expects($this->once())
+ ->method('haveDisabledConfigurations')
+ ->will($this->throwException(new \Exception()));
$args['ocConfig']->expects($this->never())
->method('getSystemValue');
@@ -69,12 +66,9 @@ class Test_CleanUp extends \PHPUnit_Framework_TestCase {
*/
public function test_runNotAllowedBySysConfig() {
$args = $this->getMocks();
- $args['helper']->expects($this->exactly(2))
- ->method('getServerConfigurationPrefixes')
- ->will($this->onConsecutiveCalls(
- array_pad(array(), 4, true),
- array_pad(array(), 4, true))
- );
+ $args['helper']->expects($this->once())
+ ->method('haveDisabledConfigurations')
+ ->will($this->returnValue(false));
$args['ocConfig']->expects($this->once())
->method('getSystemValue')
@@ -92,12 +86,9 @@ class Test_CleanUp extends \PHPUnit_Framework_TestCase {
*/
public function test_runIsAllowed() {
$args = $this->getMocks();
- $args['helper']->expects($this->exactly(2))
- ->method('getServerConfigurationPrefixes')
- ->will($this->onConsecutiveCalls(
- array_pad(array(), 4, true),
- array_pad(array(), 4, true))
- );
+ $args['helper']->expects($this->once())
+ ->method('haveDisabledConfigurations')
+ ->will($this->returnValue(false));
$args['ocConfig']->expects($this->once())
->method('getSystemValue')
--
Alioth's /usr/local/bin/git-commit-notice on /srv/git.debian.org/git/pkg-owncloud/owncloud.git
More information about the Pkg-owncloud-commits
mailing list