Skip to content

Commit 0625bf7

Browse files
committed
Adding a test for the new endpoint.
1 parent 2887467 commit 0625bf7

File tree

1 file changed

+24
-0
lines changed

1 file changed

+24
-0
lines changed

tests/Presenters/GroupsPresenter.phpt

Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1114,6 +1114,30 @@ class TestGroupsPresenter extends Tester\TestCase
11141114
);
11151115
}, BadRequestException::class);
11161116
}
1117+
1118+
public function testSetArchivedFlag()
1119+
{
1120+
PresenterTestHelper::loginDefaultAdmin($this->container);
1121+
1122+
$this->client->shouldReceive("post")->with('groups/g1/archived', Mockery::any())
1123+
->andReturn(new Response(200, ['Content-Type' => 'application/json'], json_encode([
1124+
'success' => true,
1125+
'code' => 200,
1126+
'payload' => [
1127+
self::group('g1', null, 'Root', true, ['foo' => ['bar', 'baz']]),
1128+
]
1129+
])));
1130+
1131+
$payload = PresenterTestHelper::performPresenterRequest(
1132+
$this->presenter,
1133+
'Groups',
1134+
'POST',
1135+
['action' => 'setArchived', 'id' => 'g1'],
1136+
['value' => true]
1137+
);
1138+
1139+
Assert::equal("OK", $payload);
1140+
}
11171141
}
11181142

11191143
Debugger::$logDirectory = __DIR__ . '/../../log';

0 commit comments

Comments
 (0)