summaryrefslogtreecommitdiffstats
path: root/tests
diff options
context:
space:
mode:
authorJoas Schilling <nickvergessen@owncloud.com>2015-05-11 12:37:14 +0200
committerJoas Schilling <nickvergessen@owncloud.com>2015-05-11 12:38:33 +0200
commitdfed287dc02ba7b0fb8fe16542f9e7235eae9223 (patch)
treeb37fdd7bfcc4c2129db642b32513dd4b0e979ed3 /tests
parent39497b9c3a02c383b2bd660c9114e65b732848e3 (diff)
downloadnextcloud-server-dfed287dc02ba7b0fb8fe16542f9e7235eae9223.tar.gz
nextcloud-server-dfed287dc02ba7b0fb8fe16542f9e7235eae9223.zip
Use insertIfNotExists to avoid problems with parallel calls
Diffstat (limited to 'tests')
-rw-r--r--tests/lib/appconfig.php10
1 files changed, 6 insertions, 4 deletions
diff --git a/tests/lib/appconfig.php b/tests/lib/appconfig.php
index 99ec8c2382a..adff45706cc 100644
--- a/tests/lib/appconfig.php
+++ b/tests/lib/appconfig.php
@@ -215,7 +215,7 @@ class Test_Appconfig extends \Test\TestCase {
.' WHERE `appid` = ?'), $this->equalTo(array('bar')))
->will($this->returnValue($statementMock));
$connectionMock->expects($this->once())
- ->method('insert')
+ ->method('insertIfNotExist')
->with($this->equalTo('*PREFIX*appconfig'),
$this->equalTo(
array(
@@ -223,7 +223,8 @@ class Test_Appconfig extends \Test\TestCase {
'configkey' => 'foo',
'configvalue' => 'v1',
)
- ));
+ ), $this->equalTo(['appid', 'configkey']))
+ ->willReturn(1);
$connectionMock->expects($this->never())
->method('update');
@@ -246,7 +247,7 @@ class Test_Appconfig extends \Test\TestCase {
.' WHERE `appid` = ?'), $this->equalTo(array('bar')))
->will($this->returnValue($statementMock));
$connectionMock->expects($this->once())
- ->method('insert')
+ ->method('insertIfNotExist')
->with($this->equalTo('*PREFIX*appconfig'),
$this->equalTo(
array(
@@ -254,7 +255,8 @@ class Test_Appconfig extends \Test\TestCase {
'configkey' => 'foo',
'configvalue' => 'v1',
)
- ));
+ ), $this->equalTo(['appid', 'configkey']))
+ ->willReturn(1);
$connectionMock->expects($this->once())
->method('update')
->with($this->equalTo('*PREFIX*appconfig'),