| @@ 104-127 (lines=24) @@ | ||
| 101 | /** |
|
| 102 | * Ensure tierra.topicsolved.mark_solved_after event works. |
|
| 103 | */ |
|
| 104 | public function test_mark_solved_event() |
|
| 105 | { |
|
| 106 | $topic_data = array( |
|
| 107 | 'forum_lock_solved' => '1', |
|
| 108 | 'forum_id' => 2, |
|
| 109 | 'topic_id' => 1 |
|
| 110 | ); |
|
| 111 | ||
| 112 | $this->auth->expects($this->once())->method('acl_get') |
|
| 113 | ->with('m_lock', 2)->willReturn(true); |
|
| 114 | $this->dispatcher->expects($this->once())->method('trigger_event') |
|
| 115 | ->with( |
|
| 116 | 'tierra.topicsolved.mark_solved_after', |
|
| 117 | array( |
|
| 118 | 'topic_data' => $topic_data, |
|
| 119 | 'column_data' => array( |
|
| 120 | 'topic_solved' => 5, |
|
| 121 | 'topic_status' => ITEM_LOCKED |
|
| 122 | ) |
|
| 123 | ) |
|
| 124 | )->willReturn(array()); |
|
| 125 | ||
| 126 | $this->topicsolved->mark_solved($topic_data, 5); |
|
| 127 | } |
|
| 128 | ||
| 129 | /** |
|
| 130 | * Ensure tierra.topicsolved.mark_unsolved_after event works. |
|
| @@ 132-155 (lines=24) @@ | ||
| 129 | /** |
|
| 130 | * Ensure tierra.topicsolved.mark_unsolved_after event works. |
|
| 131 | */ |
|
| 132 | public function test_mark_unsolved_event() |
|
| 133 | { |
|
| 134 | $topic_data = array( |
|
| 135 | 'forum_lock_solved' => '1', |
|
| 136 | 'forum_id' => 2, |
|
| 137 | 'topic_id' => 1 |
|
| 138 | ); |
|
| 139 | ||
| 140 | $this->auth->expects($this->once())->method('acl_get') |
|
| 141 | ->with('m_lock', 2)->willReturn(true); |
|
| 142 | $this->dispatcher->expects($this->once())->method('trigger_event') |
|
| 143 | ->with( |
|
| 144 | 'tierra.topicsolved.mark_unsolved_after', |
|
| 145 | array( |
|
| 146 | 'topic_data' => $topic_data, |
|
| 147 | 'column_data' => array( |
|
| 148 | 'topic_solved' => 0, |
|
| 149 | 'topic_status' => ITEM_UNLOCKED |
|
| 150 | ) |
|
| 151 | ) |
|
| 152 | )->willReturn(array()); |
|
| 153 | ||
| 154 | $this->topicsolved->mark_unsolved($topic_data); |
|
| 155 | } |
|
| 156 | ||
| 157 | /** |
|
| 158 | * Data set for test_image |
|