| Conditions | 1 |
| Paths | 1 |
| Total Lines | 29 |
| Code Lines | 16 |
| Lines | 0 |
| Ratio | 0 % |
| Changes | 1 | ||
| Bugs | 0 | Features | 1 |
| 1 | <?php |
||
| 20 | public function testTrackClose() |
||
| 21 | { |
||
| 22 | $visitorId = str_random('40'); |
||
| 23 | |||
| 24 | $visitor = new User(); |
||
| 25 | $visitor->visitor_id = $visitorId; |
||
|
|
|||
| 26 | $visitor->save(); |
||
| 27 | |||
| 28 | $headers['visitor-id'] = $visitorId; |
||
| 29 | |||
| 30 | $timeTracker = new TimeTracker(); |
||
| 31 | $timeTracker->open_at = Carbon::yesterday(); |
||
| 32 | $timeTracker->status = TimeTracker::PENDING; |
||
| 33 | $timeTracker->user()->associate($visitor); |
||
| 34 | $timeTracker->save(); |
||
| 35 | |||
| 36 | // send the HTTP request |
||
| 37 | $response = $this->apiCall($this->endpoint, 'post', [], true, $headers); |
||
| 38 | |||
| 39 | // assert response status is correct |
||
| 40 | $this->assertEquals($response->getStatusCode(), '202'); |
||
| 41 | |||
| 42 | $responseObject = $this->getResponseObject($response); |
||
| 43 | |||
| 44 | $this->assertEquals($responseObject->message, 'Session (close) Tracked Successfully.'); |
||
| 45 | |||
| 46 | $this->seeInDatabase('time_tracker', ['status' => TimeTracker::SUCCEEDED]); |
||
| 47 | |||
| 48 | } |
||
| 49 | |||
| 51 |
Since your code implements the magic setter
_set, this function will be called for any write access on an undefined variable. You can add the@propertyannotation to your class or interface to document the existence of this variable.Since the property has write access only, you can use the @property-write annotation instead.
Of course, you may also just have mistyped another name, in which case you should fix the error.
See also the PhpDoc documentation for @property.