| @@ 523-548 (lines=26) @@ | ||
| 520 | )); |
|
| 521 | } |
|
| 522 | ||
| 523 | public function testMerge() { |
|
| 524 | $Entries = $this->generate('Entries', |
|
| 525 | array( |
|
| 526 | 'models' => array( |
|
| 527 | 'Entry' => array('threadMerge') |
|
| 528 | ) |
|
| 529 | )); |
|
| 530 | $this->_loginUser(2); |
|
| 531 | ||
| 532 | $data = array( |
|
| 533 | 'Entry' => array( |
|
| 534 | 'targetId' => 2, |
|
| 535 | ) |
|
| 536 | ); |
|
| 537 | ||
| 538 | $Entries->Entry->expects($this->exactly(1)) |
|
| 539 | ->method('threadMerge') |
|
| 540 | ->with('2') |
|
| 541 | ->will($this->returnValue(true)); |
|
| 542 | ||
| 543 | $result = $this->testAction('/entries/merge/4', |
|
| 544 | array( |
|
| 545 | 'data' => $data, |
|
| 546 | 'method' => 'post' |
|
| 547 | )); |
|
| 548 | } |
|
| 549 | ||
| 550 | /** |
|
| 551 | * Entry does not exist |
|
| @@ 398-406 (lines=9) @@ | ||
| 395 | $this->assertContains('Name is already used.', $result); |
|
| 396 | } |
|
| 397 | ||
| 398 | public function testRs() { |
|
| 399 | $Users = $this->generate('Users', ['models' => ['User' => ['activate']]]); |
|
| 400 | $Users->User->expects($this->once()) |
|
| 401 | ->method('activate') |
|
| 402 | ->with(4, '1548') |
|
| 403 | ->will($this->returnValue(['status' => 'activated', 'User' => []])); |
|
| 404 | $result = $this->testAction('/users/rs/4/?c=1548', ['return' => 'vars']); |
|
| 405 | $this->assertEquals('activated', $result['status']); |
|
| 406 | } |
|
| 407 | ||
| 408 | public function testSetcategoryNotLoggedIn() { |
|
| 409 | $this->setExpectedException('ForbiddenException'); |
|