MCPcopy Create free account
hub / github.com/Rello/analytics / FakeActivityEvent

Class FakeActivityEvent

tests/Activity/ActivityAccessTest.php:108–206  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

106}
107
108class FakeActivityEvent implements IEvent {
109 private $app;
110 private $type;
111 private $author;
112 private $objectId;
113 private $objectName;
114 private $subject;
115 private $subjectParameters = [];
116 private $affectedUser;
117 public $richSubjectParameters = [];
118
119 public static function analyticsReportShare(): self {
120 $event = new self();
121 $event->setApp('analytics')
122 ->setType(ActivityManager::OBJECT_REPORT)
123 ->setAuthor('author')
124 ->setObject('report', 10, 'Revenue')
125 ->setSubject(ActivityManager::SUBJECT_REPORT_SHARE, ['author' => 'author']);
126
127 return $event;
128 }
129
130 public function getApp() {
131 return $this->app;
132 }
133
134 public function setApp($app) {
135 $this->app = $app;
136 return $this;
137 }
138
139 public function setType($type) {
140 $this->type = $type;
141 return $this;
142 }
143
144 public function getType() {
145 return $this->type;
146 }
147
148 public function setAuthor($author) {
149 $this->author = $author;
150 return $this;
151 }
152
153 public function getAuthor() {
154 return $this->author;
155 }
156
157 public function setObject($objectType, $objectId, $objectName = '') {
158 $this->objectId = $objectId;
159 $this->objectName = $objectName;
160 return $this;
161 }
162
163 public function getObjectId() {
164 return $this->objectId;
165 }

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected