These results are based on our legacy PHP analysis, consider migrating to our new PHP analysis engine instead. Learn more
1 | <?php |
||
2 | |||
3 | namespace OpenOrchestra\FunctionalTests\BackofficeBundle\Command; |
||
4 | |||
5 | use Symfony\Bundle\FrameworkBundle\Console\Application; |
||
6 | use OpenOrchestra\BackofficeBundle\Command\OrchestraPublishNodeCommand; |
||
7 | use OpenOrchestra\BaseBundle\Tests\AbstractTest\AbstractWebTestCase; |
||
8 | use OpenOrchestra\FunctionalTests\BackofficeBundle\Command\PublishElementCommandTrait; |
||
9 | |||
10 | /** |
||
11 | * Class OrchestraPublishNodeCommandTest |
||
12 | */ |
||
13 | View Code Duplication | class OrchestraPublishNodeCommandTest extends AbstractWebTestCase |
|
0 ignored issues
–
show
|
|||
14 | { |
||
15 | use PublishElementCommandTrait; |
||
16 | |||
17 | protected $application; |
||
18 | |||
19 | /** |
||
20 | * Set Up |
||
21 | */ |
||
22 | public function setUp() |
||
23 | { |
||
24 | $client = self::createClient(); |
||
25 | $this->application = new Application($client->getKernel()); |
||
26 | $this->application->setAutoExit(false); |
||
27 | $this->application->add(new OrchestraPublishNodeCommand()); |
||
28 | } |
||
29 | |||
30 | /** |
||
31 | * Test the command |
||
32 | * |
||
33 | * @param string $siteId |
||
34 | * |
||
35 | * @dataProvider provideSiteId |
||
36 | */ |
||
37 | public function testExecute($siteId) |
||
38 | { |
||
39 | $this->executePublish($siteId, 'orchestra:publish:node', 'open_orchestra_model.repository.node', 'node'); |
||
40 | } |
||
41 | |||
42 | /** |
||
43 | * Provide site id |
||
44 | */ |
||
45 | public function provideSiteId() |
||
46 | { |
||
47 | return array( |
||
48 | array('2'), |
||
49 | ); |
||
50 | } |
||
51 | } |
||
52 |
Duplicated code is one of the most pungent code smells. If you need to duplicate the same code in three or more different places, we strongly encourage you to look into extracting the code into a single class or operation.
You can also find more detailed suggestions in the “Code” section of your repository.