|
@@ 26-50 (lines=25) @@
|
| 23 |
|
/** |
| 24 |
|
* @dataProvider getInteractiveCommandData |
| 25 |
|
*/ |
| 26 |
|
public function testInteractiveCommand($options, $input, $expected) |
| 27 |
|
{ |
| 28 |
|
list($entity, $withoutWrite, $filterType, $template, $format, $prefix, $withoutShow, $withoutBulk, $withoutSort, $withoutPageSize, $bundleViews, $overwrite) = $expected; |
| 29 |
|
$advConfig = new Configuration(); |
| 30 |
|
$advConfig->setWithoutWrite($withoutWrite); |
| 31 |
|
$advConfig->setRoutePrefix($prefix); |
| 32 |
|
$advConfig->setFormat($format); |
| 33 |
|
$advConfig->setFilterType($filterType); |
| 34 |
|
$advConfig->setBaseTemplate($template); |
| 35 |
|
$advConfig->setWithoutShow($withoutShow); |
| 36 |
|
$advConfig->setWithoutBulk($withoutBulk); |
| 37 |
|
$advConfig->setWithoutSorting($withoutSort); |
| 38 |
|
$advConfig->setWithoutPageSize($withoutPageSize); |
| 39 |
|
$advConfig->setOverwrite($overwrite); |
| 40 |
|
$advConfig->setBundleViews($bundleViews); |
| 41 |
|
|
| 42 |
|
$generator = $this->getGenerator(); |
| 43 |
|
$generator |
| 44 |
|
->expects($this->once()) |
| 45 |
|
->method('generateCrud') |
| 46 |
|
->with($this->getBundle(), $entity, $this->getDoctrineMetadata(), $advConfig) |
| 47 |
|
; |
| 48 |
|
$tester = new CommandTester($this->getCommand($generator, $input)); |
| 49 |
|
$tester->execute($options); |
| 50 |
|
} |
| 51 |
|
|
| 52 |
|
public function getInteractiveCommandData() |
| 53 |
|
{ |
|
@@ 69-93 (lines=25) @@
|
| 66 |
|
/** |
| 67 |
|
* @dataProvider getNonInteractiveCommandData |
| 68 |
|
*/ |
| 69 |
|
public function testNonInteractiveCommand($options, $expected) |
| 70 |
|
{ |
| 71 |
|
list($entity, $withoutWrite, $filterType, $template, $format, $prefix, $withoutShow, $withoutBulk, $withoutSort, $withoutPageSize, $bundleViews, $overwrite) = $expected; |
| 72 |
|
$advConfig = new Configuration(); |
| 73 |
|
$advConfig->setWithoutWrite($withoutWrite); |
| 74 |
|
$advConfig->setRoutePrefix($prefix); |
| 75 |
|
$advConfig->setFormat($format); |
| 76 |
|
$advConfig->setFilterType($filterType); |
| 77 |
|
$advConfig->setBaseTemplate($template); |
| 78 |
|
$advConfig->setWithoutShow($withoutShow); |
| 79 |
|
$advConfig->setWithoutBulk($withoutBulk); |
| 80 |
|
$advConfig->setWithoutSorting($withoutSort); |
| 81 |
|
$advConfig->setWithoutPageSize($withoutPageSize); |
| 82 |
|
$advConfig->setBundleViews($bundleViews); |
| 83 |
|
$advConfig->setOverwrite($overwrite); |
| 84 |
|
$generator = $this->getGenerator(); |
| 85 |
|
|
| 86 |
|
$generator |
| 87 |
|
->expects($this->once()) |
| 88 |
|
->method('generateCrud') |
| 89 |
|
->with($this->getBundle(), $entity, $this->getDoctrineMetadata(), $advConfig) |
| 90 |
|
; |
| 91 |
|
$tester = new CommandTester($this->getCommand($generator, '')); |
| 92 |
|
$tester->execute($options, array('interactive' => false)); |
| 93 |
|
} |
| 94 |
|
|
| 95 |
|
public function getNonInteractiveCommandData() |
| 96 |
|
{ |