Completed
Push — dev/plugin-misc ( 7200ca...983469 )
by Kiyotaka
07:28
created

test_extend_same_table_crossed_store()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 11

Duplication

Lines 11
Ratio 100 %

Importance

Changes 0
Metric Value
cc 1
nc 1
nop 1
dl 11
loc 11
rs 9.9
c 0
b 0
f 0
1
<?php
2
3
/*
4
 * This file is part of EC-CUBE
5
 *
6
 * Copyright(c) LOCKON CO.,LTD. All Rights Reserved.
7
 *
8
 * http://www.lockon.co.jp/
9
 *
10
 * For the full copyright and license information, please view the LICENSE
11
 * file that was distributed with this source code.
12
 */
13
14
use Codeception\Util\FileSystem;
15
use Codeception\Util\Fixtures;
16
use Doctrine\ORM\EntityManager;
17
use Eccube\Common\EccubeConfig;
18
use Eccube\Entity\Plugin;
19
use Eccube\Repository\PluginRepository;
20
use Page\Admin\PluginLocalInstallPage;
21
use Page\Admin\PluginManagePage;
22
use Page\Admin\PluginSearchPage;
23
24
class EA10PluginCest
25
{
26
    /** @var EntityManager */
27
    private $em;
28
29
    /** @var \Doctrine\DBAL\Connection */
30
    private $conn;
31
32
    /** @var PluginRepository */
33
    private $pluginRepository;
34
35
    /** @var EccubeConfig */
36
    private $config;
37
38
    public function _before(\AcceptanceTester $I)
39
    {
40
        $I->loginAsAdmin();
41
42
        $this->em = Fixtures::get('entityManager');
43
        $this->conn = $this->em->getConnection();
44
        $this->pluginRepository = $this->em->getRepository(Plugin::class);
45
        $this->config = Fixtures::get('config');
46
        FileSystem::doEmptyDir('repos');
47
    }
48
49
    public function test_install_enable_disable_remove_store(\AcceptanceTester $I)
50
    {
51
        Horizon_Store::start($I)
52
            ->インストール()
53
            ->有効化()
54
            ->無効化()
55
            ->削除();
56
    }
57
58
    public function test_install_enable_disable_remove_local(\AcceptanceTester $I)
59
    {
60
        Horizon_Store::start($I)
61
            ->インストール()
62
            ->有効化()
63
            ->無効化()
64
            ->削除();
65
    }
66
67
    public function test_install_enable_disable_enable_disable_remove_store(\AcceptanceTester $I)
68
    {
69
        Horizon_Store::start($I)
70
            ->インストール()
71
            ->有効化()
72
            ->無効化()
73
            ->有効化()
74
            ->無効化()
75
            ->削除();
76
    }
77
78
    public function test_install_enable_disable_enable_disable_remove_local(\AcceptanceTester $I)
79
    {
80
        Horizon_Local::start($I)
81
            ->インストール()
82
            ->有効化()
83
            ->無効化()
84
            ->有効化()
85
            ->無効化()
86
            ->削除();
87
    }
88
89
    public function test_install_remove_local(\AcceptanceTester $I)
90
    {
91
        Horizon_Local::start($I)
92
            ->インストール()
93
            ->削除();
94
    }
95
96
    public function test_install_remove_store(\AcceptanceTester $I)
97
    {
98
        Horizon_Store::start($I)
99
            ->インストール()
100
            ->削除();
101
    }
102
103
    public function test_install_update_remove_store(\AcceptanceTester $I)
104
    {
105
        Horizon_Store::start($I)
106
            ->インストール()
107
            ->アップデート()
108
            ->削除();
109
    }
110
111
112
113
    public function test_install_update_remove_local(\AcceptanceTester $I)
114
    {
115
        Horizon_Local::start($I)
116
            ->インストール()
117
            ->アップデート()
118
            ->削除();
119
    }
120
121
    public function test_install_enable_disable_update_enable_disable_remove_local(\AcceptanceTester $I)
122
    {
123
        Horizon_Local::start($I)
124
            ->インストール()
125
            ->有効化()
126
            ->無効化()
127
            ->アップデート()
128
            ->有効化()
129
            ->無効化()
130
            ->削除();
131
    }
132
133
    public function test_install_enable_disable_update_enable_disable_remove_store(\AcceptanceTester $I)
134
    {
135
        Horizon_Store::start($I)
136
            ->インストール()
137
            ->有効化()
138
            ->無効化()
139
            ->アップデート()
140
            ->有効化()
141
            ->無効化()
142
            ->削除();
143
    }
144
145
    public function test_install_enable_update_disable_remove_store(\AcceptanceTester $I)
146
    {
147
        Horizon_Store::start($I)
148
            ->インストール()
149
            ->有効化()
150
            ->アップデート()
151
            ->無効化()
152
            ->削除();
153
    }
154
155
    public function test_install_enable_update_disable_remove_local(\AcceptanceTester $I)
156
    {
157
        Horizon_Local::start($I)
158
            ->インストール()
159
            ->有効化()
160
            ->アップデート()
161
            ->無効化()
162
            ->削除();
163
    }
164
165
    public function test_install_update_enable_disable_remove_local(\AcceptanceTester $I)
166
    {
167
        Horizon_Local::start($I)
168
            ->インストール()
169
            ->アップデート()
170
            ->有効化()
171
            ->無効化()
172
            ->削除();
173
    }
174
175
    public function test_install_update_enable_disable_remove_store(\AcceptanceTester $I)
176
    {
177
        Horizon_Store::start($I)
178
            ->インストール()
179
            ->アップデート()
180
            ->有効化()
181
            ->無効化()
182
            ->削除();
183
    }
184
185
    public function test_install_enable_enable(\AcceptanceTester $I)
186
    {
187
        Horizon_Store::start($I)
188
            ->インストール()
189
            ->新しいタブで開く()
190
            ->有効化()
191
            ->前のタブに戻る()
192
            ->既に有効なものを有効化();
193
    }
194
195
    public function test_install_disable_disable(\AcceptanceTester $I)
196
    {
197
        Horizon_Store::start($I)
198
            ->インストール()
199
            ->有効化()
200
            ->新しいタブで開く()
201
            ->無効化()
202
            ->前のタブに戻る()
203
            ->既に無効なものを無効化();
204
    }
205
206
    public function test_install_assets_local(\AcceptanceTester $I)
207
    {
208
        $this->publishPlugin('Assets-1.0.0.tgz');
209
210
        $assetsPath = $this->config['plugin_html_realdir'].'/Assets/assets/assets.js';
211
        $updatedPath = $this->config['plugin_html_realdir'].'/Assets/assets/updated.js';
212
213
        $I->assertFileNotExists($assetsPath);
214
        $I->assertFileNotExists($updatedPath);
215
216
        $ManagePage = PluginLocalInstallPage::go($I)->アップロード('plugins/Assets-1.0.0.tgz');
217
        $I->assertFileExists($assetsPath);
218
        $I->assertFileNotExists($updatedPath);
219
220
        $ManagePage->独自プラグイン_有効化('Assets');
221
        $I->assertFileExists($assetsPath);
222
        $I->assertFileNotExists($updatedPath);
223
224
        $ManagePage->独自プラグイン_無効化('Assets');
225
        $I->assertFileExists($assetsPath);
226
        $I->assertFileNotExists($updatedPath);
227
228
        $ManagePage->独自プラグイン_アップデート('Assets', 'plugins/Assets-1.0.1.tgz');
229
        $I->assertFileExists($assetsPath);
230
        $I->assertFileExists($updatedPath);
231
232
        $ManagePage->独自プラグイン_削除('Assets');
233
        $I->assertFileNotExists($assetsPath);
234
        $I->assertFileNotExists($updatedPath);
235
    }
236
237
    public function test_install_assets_store(\AcceptanceTester $I)
238
    {
239
        // 最初のバージョンを作成
240
        $this->publishPlugin('Assets-1.0.0.tgz');
241
242
        $assetsPath = $this->config['plugin_html_realdir'].'/Assets/assets/assets.js';
243
        $updatedPath = $this->config['plugin_html_realdir'].'/Assets/assets/updated.js';
244
        $I->assertFileNotExists($assetsPath);
245
        $I->assertFileNotExists($updatedPath);
246
247
        $ManagePage = PluginSearchPage::go($I)
248
            ->入手する('Assets')
249
            ->インストール();
250
        $I->assertFileNotExists($assetsPath);
251
        $I->assertFileNotExists($updatedPath);
252
253
        $ManagePage->ストアプラグイン_有効化('Assets');
254
        $I->assertFileExists($assetsPath);
255
        $I->assertFileNotExists($updatedPath);
256
257
        $ManagePage->ストアプラグイン_無効化('Assets');
258
        $I->assertFileExists($assetsPath);
259
        $I->assertFileNotExists($updatedPath);
260
261
        // 新しいバージョンを作成
262
        $this->publishPlugin('Assets-1.0.1.tgz');
263
264
        $I->reloadPage();
265
        $ManagePage->ストアプラグイン_アップデート('Assets')->アップデート();
266
        $I->assertFileExists($assetsPath);
267
        $I->assertFileExists($updatedPath);
268
269
        $ManagePage->ストアプラグイン_削除('Assets');
270
        $I->assertFileNotExists($assetsPath);
271
        $I->assertFileNotExists($updatedPath);
272
    }
273
274 View Code Duplication
    public function test_extend_same_table_store(\AcceptanceTester $I)
0 ignored issues
show
Duplication introduced by
This method seems to be duplicated in your project.

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.

Loading history...
275
    {
276
        $Horizon = Horizon_Store::start($I);
277
        $Boomerang = Boomerang_Store::start($I);
278
279
        $Horizon->インストール()->有効化();
280
        $Boomerang->インストール()->有効化();
281
282
        $Horizon->検証()->無効化()->削除();
283
        $Boomerang->検証()->無効化()->削除();
284
    }
285
286 View Code Duplication
    public function test_extend_same_table_local(\AcceptanceTester $I)
0 ignored issues
show
Duplication introduced by
This method seems to be duplicated in your project.

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.

Loading history...
287
    {
288
        $Horizon = Horizon_Local::start($I);
289
        $Boomerang = Boomerang_Local::start($I);
290
291
        $Horizon->インストール()->有効化();
292
        $Boomerang->インストール()->有効化();
293
294
        $Horizon->検証()->無効化()->削除();
295
        $Boomerang->検証()->無効化()->削除();
296
    }
297
298 View Code Duplication
    public function test_extend_same_table_crossed_store(\AcceptanceTester $I)
0 ignored issues
show
Duplication introduced by
This method seems to be duplicated in your project.

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.

Loading history...
299
    {
300
        $Horizon = Horizon_Store::start($I);
301
        $Boomerang = Boomerang_Store::start($I);
302
303
        $Horizon->インストール()->有効化()->無効化();
304
        $Boomerang->インストール()->有効化();
305
306
        $Horizon->検証()->削除();
307
        $Boomerang->検証()->無効化()->削除();
308
    }
309
310 View Code Duplication
    public function test_extend_same_table_crossed_local(\AcceptanceTester $I)
0 ignored issues
show
Duplication introduced by
This method seems to be duplicated in your project.

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.

Loading history...
311
    {
312
        $Horizon = Horizon_Local::start($I);
313
        $Boomerang = Boomerang_Local::start($I);
314
315
        $Horizon->インストール()->有効化()->無効化();
316
        $Boomerang->インストール()->有効化();
317
318
        $Horizon->検証()->削除();
319
        $Boomerang->検証()->無効化()->削除();
320
    }
321
322
    private function publishPlugin($fileName)
323
    {
324
        copy(codecept_data_dir().'/'.'plugins/'.$fileName, codecept_root_dir().'/repos/'.$fileName);
325
    }
326
}
327
328
abstract class Abstract_Plugin
329
{
330
    /** @var AcceptanceTester */
331
    protected $I;
332
333
    /** @var EntityManager */
334
    protected $em;
335
336
    /** @var \Doctrine\DBAL\Connection */
337
    protected $conn;
338
339
    /** @var PluginRepository */
340
    protected $pluginRepository;
341
342
    /** @var EccubeConfig */
343
    protected $config;
344
345
    protected $initialized = false;
346
347
    protected $enabled = false;
348
349
    protected $removed = false;
350
351
    protected $table;
352
353
    protected $column;
354
355
    protected $traitTarget;
356
357
    protected $trait;
358
359
    public function __construct(\AcceptanceTester $I)
360
    {
361
        $this->I = $I;
362
        $this->em = Fixtures::get('entityManager');
363
        $this->conn = $this->em->getConnection();
364
        $this->pluginRepository = $this->em->getRepository(Plugin::class);
365
        $this->config = Fixtures::get('config');
366
    }
367
368 View Code Duplication
    public function tableExists()
0 ignored issues
show
Duplication introduced by
This method seems to be duplicated in your project.

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.

Loading history...
369
    {
370
        if ($this->table) {
371
            $exists = $this->conn->executeQuery("SELECT count(*) AS count FROM information_schema.columns WHERE table_name = '".$this->table."';")->fetch()['count'] > 0;
372
            $this->I->assertTrue($exists, 'テーブルがあるはず '.$this->table);
373
        }
374
    }
375
376 View Code Duplication
    public function tableNotExists()
0 ignored issues
show
Duplication introduced by
This method seems to be duplicated in your project.

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.

Loading history...
377
    {
378
        if ($this->table) {
379
            $exists = $this->conn->executeQuery("SELECT count(*) AS count FROM information_schema.columns WHERE table_name = '".$this->table."';")->fetch()['count'] > 0;
380
            $this->I->assertFalse($exists, 'テーブルがないはず '.$this->table);
381
        }
382
    }
383
384 View Code Duplication
    public function columnExists()
0 ignored issues
show
Duplication introduced by
This method seems to be duplicated in your project.

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.

Loading history...
385
    {
386
        if ($this->column) {
387
            list($tableName, $columnName) = explode('.', $this->column);
388
            $exists = $this->conn->executeQuery("SELECT count(*) AS count FROM information_schema.columns WHERE table_name = '${tableName}' AND column_name = '${columnName}';")->fetch()['count'] == 1;
389
            $this->I->assertTrue($exists, 'カラムがあるはず '.$this->column);
390
        }
391
    }
392
393 View Code Duplication
    public function columnNotExists()
0 ignored issues
show
Duplication introduced by
This method seems to be duplicated in your project.

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.

Loading history...
394
    {
395
        if ($this->column) {
396
            list($tableName, $columnName) = explode('.', $this->column);
397
            $exists = $this->conn->executeQuery("SELECT count(*) AS count FROM information_schema.columns WHERE table_name = '${tableName}' AND column_name = '${columnName}';")->fetch()['count'] == 1;
398
            $this->I->assertFalse($exists, 'カラムがないはず '.$this->column);
399
        }
400
    }
401
402
    public function traitExists()
403
    {
404
        if ($this->trait) {
405
            $this->I->assertContains($this->trait, file_get_contents($this->config['kernel.project_dir'].'/app/proxy/entity/'.$this->traitTarget.'.php'), 'Traitがあるはず');
406
        }
407
    }
408
409
    public function traitNotExists()
410
    {
411
        if ($this->trait) {
412
            $file = $this->config['kernel.project_dir'].'/app/proxy/entity/'.$this->traitTarget.'.php';
413
            if (file_exists($file)) {
414
                $this->I->assertNotContains($this->trait, file_get_contents($file), 'Traitがないはず');
415
            } else {
416
                $this->I->assertTrue(true, 'Traitがないはず');
417
            }
418
        }
419
    }
420
421
    public function 新しいタブで開く()
422
    {
423
        $this->I->executeJS("window.open(location.href, 'other')");
424
        $this->I->switchToWindow('other');
425
        return $this;
426
    }
427
428
    public function 前のタブに戻る()
429
    {
430
        $this->I->switchToPreviousTab();
431
        return $this;
432
    }
433
434
    public function 検証()
435
    {
436
        if ($this->initialized) {
437
            $this->tableExists();
438
            $this->columnExists();
439
        } else {
440
            $this->tableNotExists();
441
            $this->columnNotExists();
442
        }
443
444
        if ($this->enabled) {
445
            $this->traitExists();
446
        } else {
447
            $this->traitNotExists();
448
        }
449
450
        return $this;
451
    }
452
}
453
454
class Store_Plugin extends Abstract_Plugin
455
{
456
    /** @var PluginManagePage */
457
    private $ManagePage;
458
459
    /** @var Plugin */
460
    private $Plugin;
461
462
    private $code;
463
464
    public function __construct(AcceptanceTester $I, $code)
465
    {
466
        parent::__construct($I);
467
        $this->code = $code;
468
        $this->publishPlugin($this->code.'-1.0.0.tgz');
469
    }
470
471
    public function インストール()
472
    {
473
        /*
474
         * インストール
475
         */
476
        $this->ManagePage = PluginSearchPage::go($this->I)
477
            ->入手する($this->code)
478
            ->インストール();
479
480
        $this->検証();
481
482
        $this->Plugin = $this->pluginRepository->findByCode($this->code);
483
        $this->I->assertFalse($this->Plugin->isInitialized(), '初期化されていない');
484
        $this->I->assertFalse($this->Plugin->isEnabled(), '有効化されていない');
485
486
        return $this;
487
    }
488
489 View Code Duplication
    public function 有効化()
0 ignored issues
show
Duplication introduced by
This method seems to be duplicated in your project.

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.

Loading history...
490
    {
491
        $this->ManagePage->ストアプラグイン_有効化($this->code);
492
493
        $this->initialized = true;
494
        $this->enabled = true;
495
496
        $this->検証();
497
498
        $this->em->refresh($this->Plugin);
499
        $this->I->assertTrue($this->Plugin->isInitialized(), '初期化されている');
500
        $this->I->assertTrue($this->Plugin->isEnabled(), '有効化されている');
501
        return $this;
502
    }
503
504
    public function 既に有効なものを有効化()
505
    {
506
        $this->ManagePage->ストアプラグイン_有効化($this->code, '既に有効です。');
507
508
        $this->initialized = true;
509
        $this->enabled = true;
510
511
        $this->検証();
512
513
        $this->em->refresh($this->Plugin);
514
        $this->I->assertTrue($this->Plugin->isInitialized(), '初期化されている');
515
        $this->I->assertTrue($this->Plugin->isEnabled(), '有効化されている');
516
517
518
        return $this;
519
    }
520
521
    public function 無効化()
522
    {
523
        $this->ManagePage->ストアプラグイン_無効化($this->code);
524
525
        $this->enabled = false;
526
527
        $this->検証();
528
529
        $this->em->refresh($this->Plugin);
530
        $this->I->assertTrue($this->Plugin->isInitialized(), '初期化されている');
531
        $this->I->assertFalse($this->Plugin->isEnabled(), '無効化されている');
532
533
        return $this;
534
    }
535
536
    public function 既に無効なものを無効化()
537
    {
538
        $this->ManagePage->ストアプラグイン_無効化($this->code, '既に無効です。');
539
540
        $this->enabled = false;
541
542
        $this->検証();
543
544
        $this->em->refresh($this->Plugin);
545
        $this->I->assertTrue($this->Plugin->isInitialized(), '初期化されている');
546
        $this->I->assertFalse($this->Plugin->isEnabled(), '無効化されている');
547
548
        return $this;
549
    }
550
551 View Code Duplication
    public function 削除()
0 ignored issues
show
Duplication introduced by
This method seems to be duplicated in your project.

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.

Loading history...
552
    {
553
        $this->ManagePage->ストアプラグイン_削除($this->code);
554
555
        $this->initialized = false;
556
        $this->enabled = false;
557
558
        $this->検証();
559
560
        $this->em->refresh($this->Plugin);
561
        $this->Plugin = $this->pluginRepository->findByCode($this->code);
562
        $this->I->assertNull($this->Plugin, '削除されている');
563
564
        return $this;
565
    }
566
567
    public function アップデート()
568
    {
569
        $this->publishPlugin($this->code.'-1.0.1.tgz');
570
571
        $this->I->reloadPage();
572
        $this->ManagePage->ストアプラグイン_アップデート($this->code)->アップデート();
573
574
        $this->initialized = true;
575
576
        $this->検証();
577
578
        $this->em->refresh($this->Plugin);
579
        $this->I->assertEquals($this->initialized, $this->Plugin->isInitialized(), '初期化');
580
        $this->I->assertEquals($this->enabled, $this->Plugin->isEnabled(), '有効/無効');
581
582
        return $this;
583
    }
584
585
    private function publishPlugin($fileName)
586
    {
587
        $published = copy(codecept_data_dir().'/'.'plugins/'.$fileName, codecept_root_dir().'/repos/'.$fileName);
588
        $this->I->assertTrue($published, "公開できた ${fileName}");
589
        $output = [];
590
        exec("ls -ltra repos/", $output);
591
        echo implode(PHP_EOL, $output).PHP_EOL;
592
    }
593
}
594
595
class Local_Plugin extends Abstract_Plugin
596
{
597
    /** @var PluginManagePage */
598
    private $ManagePage;
599
600
    /** @var Plugin */
601
    private $Plugin;
602
603
    /** @var string */
604
    private $code;
605
606
    public function __construct(AcceptanceTester $I, $code)
607
    {
608
        parent::__construct($I);
609
        $this->code = $code;
610
    }
611
612
    public function インストール()
613
    {
614
        $this->ManagePage = PluginLocalInstallPage::go($this->I)
615
            ->アップロード('plugins/'.$this->code.'-1.0.0.tgz');
616
617
        $this->initialized = true;
618
619
        $this->I->see('プラグインをインストールしました。', PluginManagePage::完了メーッセージ);
620
621
        $this->検証();
622
623
        $this->Plugin = $this->pluginRepository->findByCode($this->code);
624
        $this->I->assertTrue($this->Plugin->isInitialized(), '初期化されていない');
625
        $this->I->assertFalse($this->Plugin->isEnabled(), '有効化されていない');
626
627
        return $this;
628
    }
629
630
    public function 有効化()
631
    {
632
        $this->ManagePage->独自プラグイン_有効化($this->code);
633
634
        $this->enabled = true;
635
636
        $this->検証();
637
638
        $this->em->refresh($this->Plugin);
639
        $this->I->assertTrue($this->Plugin->isInitialized(), '初期化されている');
640
        $this->I->assertTrue($this->Plugin->isEnabled(), '有効化されている');
641
        return $this;
642
    }
643
644
    public function 無効化()
645
    {
646
        $this->ManagePage->独自プラグイン_無効化($this->code);
647
648
        $this->enabled = false;
649
650
        $this->検証();
651
652
        $this->em->refresh($this->Plugin);
653
        $this->I->assertTrue($this->Plugin->isInitialized(), '初期化されている');
654
        $this->I->assertFalse($this->Plugin->isEnabled(), '無効化されている');
655
656
        return $this;
657
    }
658
659 View Code Duplication
    public function 削除()
0 ignored issues
show
Duplication introduced by
This method seems to be duplicated in your project.

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.

Loading history...
660
    {
661
        $this->ManagePage->独自プラグイン_削除($this->code);
662
663
        $this->initialized = false;
664
        $this->enabled = false;
665
666
        $this->I->see('プラグインを削除しました。', PluginManagePage::完了メーッセージ);
667
668
        $this->検証();
669
670
        $this->em->refresh($this->Plugin);
671
        $this->Plugin = $this->pluginRepository->findByCode($this->code);
672
        $this->I->assertNull($this->Plugin, '削除されている');
673
674
        return $this;
675
    }
676
677
    public function アップデート()
678
    {
679
        $this->ManagePage->独自プラグイン_アップデート($this->code, 'plugins/'.$this->code.'-1.0.1.tgz');
680
681
        $this->検証();
682
683
        $this->em->refresh($this->Plugin);
684
        $this->I->assertTrue($this->Plugin->isInitialized(), '初期化されている');
685
        $this->I->assertEquals($this->enabled, $this->Plugin->isEnabled(), '有効/無効');
686
687
        return $this;
688
    }
689
}
690
691 View Code Duplication
class Horizon_Local extends Local_Plugin
0 ignored issues
show
Duplication introduced by
This class seems to be duplicated in your project.

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.

Loading history...
692
{
693
    public function __construct(AcceptanceTester $I)
694
    {
695
        parent::__construct($I, 'Horizon');
696
        $this->table = 'dtb_dash';
697
        $this->column = 'dtb_cart.is_horizon';
698
        $this->trait = '\Plugin\Horizon\Entity\CartTrait';
699
        $this->traitTarget = 'Cart';
700
    }
701
702
    public static function start(AcceptanceTester $I)
703
    {
704
        return new self($I);
705
    }
706
}
707
708 View Code Duplication
class Horizon_Store extends Store_Plugin
0 ignored issues
show
Duplication introduced by
This class seems to be duplicated in your project.

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.

Loading history...
709
{
710
    public function __construct(AcceptanceTester $I)
711
    {
712
        parent::__construct($I, 'Horizon');
713
        $this->table = 'dtb_dash';
714
        $this->column = 'dtb_cart.is_horizon';
715
        $this->trait = '\Plugin\Horizon\Entity\CartTrait';
716
        $this->traitTarget = 'Cart';
717
    }
718
719
    public static function start(AcceptanceTester $I)
720
    {
721
        return new self($I);
722
    }
723
}
724
725 View Code Duplication
class Boomerang_Store extends Store_Plugin
0 ignored issues
show
Duplication introduced by
This class seems to be duplicated in your project.

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.

Loading history...
726
{
727
    public function __construct(AcceptanceTester $I)
728
    {
729
        parent::__construct($I, 'Boomerang');
730
        $this->column = 'dtb_cart.is_boomerang';
731
        $this->trait = '\Plugin\Boomerang\Entity\CartTrait';
732
        $this->traitTarget = 'Cart';
733
    }
734
735
    public static function start(AcceptanceTester $I)
736
    {
737
        return new self($I);
738
    }
739
}
740
741 View Code Duplication
class Boomerang_Local extends Local_Plugin
0 ignored issues
show
Duplication introduced by
This class seems to be duplicated in your project.

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.

Loading history...
742
{
743
    public function __construct(AcceptanceTester $I)
744
    {
745
        parent::__construct($I, 'Boomerang');
746
        $this->column = 'dtb_cart.is_boomerang';
747
        $this->trait = '\Plugin\Boomerang\Entity\CartTrait';
748
        $this->traitTarget = 'Cart';
749
    }
750
751
    public static function start(AcceptanceTester $I)
752
    {
753
        return new self($I);
754
    }
755
}