diff options
author | Joas Schilling <coding@schilljs.com> | 2017-02-23 18:03:07 +0300 |
---|---|---|
committer | Joas Schilling <coding@schilljs.com> | 2017-02-23 18:03:07 +0300 |
commit | c1b861d6acf39b43d448e2ab0380bcc15ec18e36 (patch) | |
tree | 0762459554e2a6e37e91950dfde97e9bc45fa6be /lib/Activity | |
parent | 680a0189593e8f46662e823c52a954e93725d288 (diff) |
Add unit tests
Signed-off-by: Joas Schilling <coding@schilljs.com>
Diffstat (limited to 'lib/Activity')
-rw-r--r-- | lib/Activity/Provider.php | 33 |
1 files changed, 17 insertions, 16 deletions
diff --git a/lib/Activity/Provider.php b/lib/Activity/Provider.php index 1a515da0c..26c5a5bb3 100644 --- a/lib/Activity/Provider.php +++ b/lib/Activity/Provider.php @@ -111,6 +111,23 @@ class Provider implements IProvider { } /** + * @param IEvent $event + * @param string $subject + * @param array $parameters + * @throws \InvalidArgumentException + */ + protected function setSubjects(IEvent $event, $subject, array $parameters) { + $placeholders = $replacements = []; + foreach ($parameters as $placeholder => $parameter) { + $placeholders[] = '{' . $placeholder . '}'; + $replacements[] = $parameter['name']; + } + + $event->setParsedSubject(str_replace($placeholders, $replacements, $subject)) + ->setRichSubject($subject, $parameters); + } + + /** * @param array $parameters * @param Room $room * @return array @@ -129,22 +146,6 @@ class Provider implements IProvider { } /** - * @param IEvent $event - * @param string $subject - * @param array $parameters - */ - protected function setSubjects(IEvent $event, $subject, array $parameters) { - $placeholders = $replacements = []; - foreach ($parameters as $placeholder => $parameter) { - $placeholders[] = '{' . $placeholder . '}'; - $replacements[] = $parameter['name']; - } - - $event->setParsedSubject(str_replace($placeholders, $replacements, $subject)) - ->setRichSubject($subject, $parameters); - } - - /** * @param Room $room * @return array */ |