diff options
Diffstat (limited to 'tests/lib/preferences.php')
-rw-r--r-- | tests/lib/preferences.php | 52 |
1 files changed, 0 insertions, 52 deletions
diff --git a/tests/lib/preferences.php b/tests/lib/preferences.php index a8236909ded..f1f6ed08003 100644 --- a/tests/lib/preferences.php +++ b/tests/lib/preferences.php @@ -144,58 +144,6 @@ class Test_Preferences_Object extends PHPUnit_Framework_TestCase { $this->assertEquals(array('foo'), $apps); } - public function testGetApps() - { - $statementMock = $this->getMock('\Doctrine\DBAL\Statement', array(), array(), '', false); - $statementMock->expects($this->exactly(2)) - ->method('fetchColumn') - ->will($this->onConsecutiveCalls('foo', false)); - $connectionMock = $this->getMock('\OC\DB\Connection', array(), array(), '', false); - $connectionMock->expects($this->once()) - ->method('executeQuery') - ->with($this->equalTo('SELECT DISTINCT `appid` FROM `*PREFIX*preferences` WHERE `userid` = ?'), - $this->equalTo(array('bar'))) - ->will($this->returnValue($statementMock)); - - $preferences = new OC\Preferences($connectionMock); - $apps = $preferences->getApps('bar'); - $this->assertEquals(array('foo'), $apps); - } - - public function testGetKeys() - { - $statementMock = $this->getMock('\Doctrine\DBAL\Statement', array(), array(), '', false); - $statementMock->expects($this->exactly(2)) - ->method('fetchColumn') - ->will($this->onConsecutiveCalls('foo', false)); - $connectionMock = $this->getMock('\OC\DB\Connection', array(), array(), '', false); - $connectionMock->expects($this->once()) - ->method('executeQuery') - ->with($this->equalTo('SELECT `configkey` FROM `*PREFIX*preferences` WHERE `userid` = ? AND `appid` = ?'), - $this->equalTo(array('bar', 'moo'))) - ->will($this->returnValue($statementMock)); - - $preferences = new OC\Preferences($connectionMock); - $keys = $preferences->getKeys('bar', 'moo'); - $this->assertEquals(array('foo'), $keys); - } - - public function testGetValue() - { - $connectionMock = $this->getMock('\OC\DB\Connection', array(), array(), '', false); - $connectionMock->expects($this->exactly(2)) - ->method('fetchAssoc') - ->with($this->equalTo('SELECT `configvalue` FROM `*PREFIX*preferences` WHERE `userid` = ? AND `appid` = ? AND `configkey` = ?'), - $this->equalTo(array('grg', 'bar', 'red'))) - ->will($this->onConsecutiveCalls(array('configvalue'=>'foo'), null)); - - $preferences = new OC\Preferences($connectionMock); - $value = $preferences->getValue('grg', 'bar', 'red'); - $this->assertEquals('foo', $value); - $value = $preferences->getValue('grg', 'bar', 'red', 'def'); - $this->assertEquals('def', $value); - } - public function testSetValue() { $connectionMock = $this->getMock('\OC\DB\Connection', array(), array(), '', false); |