| @@ 723-733 (lines=11) @@ | ||
| 720 | $this->testAction('/entries/view/' . $id); |
|
| 721 | } |
|
| 722 | ||
| 723 | public function testViewIncreaseViewCounterLoggedIn() { |
|
| 724 | $Entries = $this->generate('Entries', [ |
|
| 725 | 'models' => ['Entry' => ['incrementViews']] |
|
| 726 | ]); |
|
| 727 | $id = 1; |
|
| 728 | $Entries->Entry->expects($this->once()) |
|
| 729 | ->method('incrementViews') |
|
| 730 | ->with($id); |
|
| 731 | $this->_loginUser(1); |
|
| 732 | $this->testAction('/entries/view/' . $id); |
|
| 733 | } |
|
| 734 | ||
| 735 | /** |
|
| 736 | * don't increase view counter if user views its own posting |
|
| @@ 28-40 (lines=13) @@ | ||
| 25 | 'app.upload' |
|
| 26 | ); |
|
| 27 | ||
| 28 | public function testUnsubscribe() { |
|
| 29 | $Esnotifications = $this->generate('Esnotifications', array( |
|
| 30 | 'models' => array( |
|
| 31 | 'Esnotification' => array('deleteNotificationWithId') |
|
| 32 | ) |
|
| 33 | )); |
|
| 34 | $Esnotifications->Esnotification->expects($this->once()) |
|
| 35 | ->method('deleteNotificationWithId') |
|
| 36 | ->with(4) |
|
| 37 | ->will($this->returnValue(true)); |
|
| 38 | ||
| 39 | $result = $this->testAction('/esnotifications/unsubscribe/4/token:4234/'); |
|
| 40 | } |
|
| 41 | ||
| 42 | public function testUnsubscribeWrongToken() { |
|
| 43 | $Esnotifications = $this->generate('Esnotifications', array( |
|