diff options
author | Tobia De Koninck <tobia@ledfan.be> | 2017-07-29 14:54:55 +0300 |
---|---|---|
committer | Tobia De Koninck <tobia@ledfan.be> | 2017-07-29 14:54:58 +0300 |
commit | bcad36c33adbade5dd84ba6ef2a38969e36fe53e (patch) | |
tree | 08d1c6d9b7aff045b8c45eb35ca4ca90c64834d5 /tests/unit | |
parent | b545ff132caa0a5f183787ea5f864bb76ae4ef08 (diff) |
Fix tests and styling
Diffstat (limited to 'tests/unit')
-rw-r--r-- | tests/unit/stanzahandlers/IQTest.php | 14 |
1 files changed, 13 insertions, 1 deletions
diff --git a/tests/unit/stanzahandlers/IQTest.php b/tests/unit/stanzahandlers/IQTest.php index 8ab22be..6c15c56 100644 --- a/tests/unit/stanzahandlers/IQTest.php +++ b/tests/unit/stanzahandlers/IQTest.php @@ -3,6 +3,7 @@ namespace OCA\OJSXC\StanzaHandlers; use OCA\OJSXC\Db\IQRoster; +use OCP\IConfig; use PHPUnit_Framework_MockObject_MockObject; use PHPUnit_Framework_TestCase; @@ -29,12 +30,18 @@ class IQTest extends PHPUnit_Framework_TestCase */ private $host; + /** + * @var PHPUnit_Framework_MockObject_MockObject | IConfig + */ + private $config; + public function setUp() { $this->host = 'localhost'; $this->userId = 'john'; $this->userManager = $this->getMockBuilder('OCP\IUserManager')->disableOriginalConstructor()->getMock(); - $this->iq = new IQ($this->userId, $this->host, $this->userManager); + $this->config = $this->getMockBuilder('OCP\IConfig')->disableOriginalConstructor()->getMock(); + $this->iq = new IQ($this->userId, $this->host, $this->userManager, $this->config); } public function iqRosterProvider() @@ -144,6 +151,11 @@ class IQTest extends PHPUnit_Framework_TestCase */ public function testIqRoster(array $stanza, array $users, $searchCount, $expected) { + $this->config->expects($this->once()) + ->method('getSystemValue') + ->with('debug') + ->will($this->returnValue(false)); + $this->userManager->expects($searchCount) ->method('search') ->with('') |