|
@@ 486-499 (lines=14) @@
|
| 483 |
|
* @return void |
| 484 |
|
* @covers ::main |
| 485 |
|
*/ |
| 486 |
|
public function testMainExecuteDefinedSeedersNoTruncate() { |
| 487 |
|
$this->_createShellMock( |
| 488 |
|
array('out', '_truncateModels', '_callSeeders'), |
| 489 |
|
'SeederShellWithTasks' |
| 490 |
|
); |
| 491 |
|
|
| 492 |
|
// Disable truncate |
| 493 |
|
$this->_shell->params['no-truncate'] = true; |
| 494 |
|
|
| 495 |
|
$this->_shell->expects($this->never())->method('_truncateModels'); |
| 496 |
|
$this->_shell->expects($this->at(0))->method('_callSeeders'); |
| 497 |
|
|
| 498 |
|
$this->_shell->main(); |
| 499 |
|
} |
| 500 |
|
|
| 501 |
|
/** |
| 502 |
|
* Test the main method with seeders defined with truncate |
|
@@ 507-520 (lines=14) @@
|
| 504 |
|
* @return void |
| 505 |
|
* @covers ::main |
| 506 |
|
*/ |
| 507 |
|
public function testMainExecuteDefinedSeedersWithTruncate() { |
| 508 |
|
$this->_createShellMock( |
| 509 |
|
array('out', '_truncateModels', '_callSeeders'), |
| 510 |
|
'SeederShellWithTasks' |
| 511 |
|
); |
| 512 |
|
|
| 513 |
|
// Enable truncate |
| 514 |
|
$this->_shell->params['no-truncate'] = false; |
| 515 |
|
|
| 516 |
|
$this->_shell->expects($this->at(0))->method('_truncateModels'); |
| 517 |
|
$this->_shell->expects($this->at(1))->method('_callSeeders'); |
| 518 |
|
|
| 519 |
|
$this->_shell->main(); |
| 520 |
|
} |
| 521 |
|
|
| 522 |
|
/** |
| 523 |
|
* Test the _truncateModels method |