Skip to content

Commit

Permalink
Fixed create group API
Browse files Browse the repository at this point in the history
  • Loading branch information
kenyasue committed Dec 24, 2013
1 parent 0549c6f commit cada7e0
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 4 deletions.
2 changes: 0 additions & 2 deletions src/Spika/Controller/GroupController.php
Original file line number Diff line number Diff line change
Expand Up @@ -89,8 +89,6 @@ function (Request $request) use ($app,$self) {
if($result == null)
return $self->returnErrorResponse("create group failed");

$result = json_decode($result,true);

if(isset($result['id'])){
$newGroupId = $result['id'];
$app['spikadb']->subscribeGroup($newGroupId,$ownerId);
Expand Down
4 changes: 2 additions & 2 deletions tests/Spika/Controller/GroupControllerTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ public function createApplication()
$spikadb = $this->getMock('\Spika\Db\DbInterface');
$spikadb->expects($this->any())
->method('createGroup')
->will($this->returnValue('{"id":"testgroup"}'));
->will($this->returnValue(array('id'=>'testGroup')));

$spikadb->expects($this->any())
->method('updateGroup')
Expand Down Expand Up @@ -96,7 +96,7 @@ public function createGroupRegularCaseTest()
json_encode($sendParams)
);

assertRegExp("/testgroup/", $client->getResponse()->getContent());
assertRegExp("/testGroup/", $client->getResponse()->getContent());
}

/** @test */
Expand Down

0 comments on commit cada7e0

Please sign in to comment.