Skip to content

Commit

Permalink
Run CS Fixer
Browse files Browse the repository at this point in the history
  • Loading branch information
LEDfan committed Feb 10, 2018
1 parent 972016e commit 56768ab
Show file tree
Hide file tree
Showing 4 changed files with 20 additions and 27 deletions.
24 changes: 12 additions & 12 deletions tests/integration/RosterPushTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,8 @@
use PHPUnit\Framework\TestCase;
use PHPUnit\Framework\MockObject\MockObject;

class RosterPushTest extends TestCase {
class RosterPushTest extends TestCase
{

/**
* @var RosterPush
Expand Down Expand Up @@ -60,8 +61,8 @@ class RosterPushTest extends TestCase {
*/
private $contactsStore;

public function setUp() {

public function setUp()
{
if (!Application::contactsStoreApiSupported()) {
$this->markTestSkipped();
return;
Expand All @@ -83,12 +84,14 @@ public function setUp() {
$this->config
);

$this->rosterPush = new RosterPush($this->userManager,
$this->rosterPush = new RosterPush(
$this->userManager,
$this->userSession,
'localhost',
$this->iqRosterPushMapper,
$this->dbConnection,
$this->userProvider);
$this->userProvider
);

foreach (\OC::$server->getUserManager()->search('') as $user) {
$user->delete();
Expand All @@ -98,8 +101,8 @@ public function setUp() {
}
}

public function testRemoveRosterItemForUsersInGroup() {

public function testRemoveRosterItemForUsersInGroup()
{
$group1 = $this->groupManager->createGroup('group1');
$group2 = $this->groupManager->createGroup('group2');
$group3 = $this->groupManager->createGroup('group3');
Expand Down Expand Up @@ -127,10 +130,9 @@ public function testRemoveRosterItemForUsersInGroup() {
->with($user3, 0, 'user1')
->willReturn([$user3]);
$this->rosterPush->removeRosterItemForUsersInGroup($group1, 'user1');

}
public function testRemoveRosterItemForUsersInGroupOwnGroups() {

public function testRemoveRosterItemForUsersInGroupOwnGroups()
{
$group1 = $this->groupManager->createGroup('group1');
$group2 = $this->groupManager->createGroup('group2');
$group3 = $this->groupManager->createGroup('group3');
Expand Down Expand Up @@ -169,6 +171,4 @@ public function testRemoveRosterItemForUsersInGroupOwnGroups() {

$this->config->setAppValue('core', 'shareapi_only_share_with_group_members', 'no');
}


}
11 changes: 4 additions & 7 deletions tests/unit/HooksTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -169,20 +169,19 @@ public function testOnChangeUserDisplayName()
$hooks->onChangeUser($user, 'displayName', 'abc');
}

public function testOnAddUserToGroup() {

public function testOnAddUserToGroup()
{
$user = $this->getMockBuilder(IUser::class)->disableOriginalConstructor()->getMock();
$group = $this->getMockBuilder(IGroup::class)->disableOriginalConstructor()->getMock();

$this->rosterPush->expects($this->once())->method('createOrUpdateRosterItem')->with($user);
$this->rosterPush->expects($this->once())->method('addUserToGroup')->with($user, $group);

$this->hooks->onAddUserToGroup($group, $user);

}

public function testOnRemoveUserFromGroup() {

public function testOnRemoveUserFromGroup()
{
$user = $this->getMockBuilder(IUser::class)->disableOriginalConstructor()->getMock();
$group = $this->getMockBuilder(IGroup::class)->disableOriginalConstructor()->getMock();

Expand All @@ -194,7 +193,5 @@ public function testOnRemoveUserFromGroup() {
$this->rosterPush->expects($this->once())->method('removeUserFromGroup')->with($user, $group);

$this->hooks->onRemoveUserFromGroup($group, $user);

}

}
1 change: 0 additions & 1 deletion tests/unit/RosterPushTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -267,5 +267,4 @@ public function testCreateOrUpdateRosterItem()
}

// removeRosterItemForUsersInGroup, addUserToGroup and removeUserFromGroup covered by integration tests

}
11 changes: 4 additions & 7 deletions tests/unit/UserTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -4,11 +4,10 @@
use OCA\OJSXC\User;
use PHPUnit\Framework\TestCase;

class UserTest extends TestCase {


public function test() {

class UserTest extends TestCase
{
public function test()
{
$user1 = new User(" test @ 'abc", 'Test123', null);

$this->assertEquals($user1->getFullName(), 'Test123');
Expand All @@ -17,7 +16,5 @@ public function test() {
$user1->setFullName('test2');
$this->assertEquals($user1->getUid(), 'test1');
$this->assertEquals($user1->getFullName(), 'test2');

}

}

0 comments on commit 56768ab

Please sign in to comment.