Completed
Push — dev/plugin-misc ( 5b9e26...2bf309 )
by Kiyotaka
06:17
created

Abstract_Plugin::検証()   A

Complexity

Conditions 3
Paths 4

Size

Total Lines 16

Duplication

Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
cc 3
nc 4
nop 0
dl 0
loc 16
rs 9.7333
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_enable_disable_remove_store(\AcceptanceTester $I)
50
    {
51
        Horizon_Store::start($I)
52
            ->インストール()
53
            ->有効化()
54
            ->無効化()
55
            ->有効化()
56
            ->無効化()
57
            ->削除();
58
    }
59
60
    public function test_install_enable_disable_enable_disable_remove_local(\AcceptanceTester $I)
61
    {
62
        Horizon_Local::start($I)
63
            ->インストール()
64
            ->有効化()
65
            ->無効化()
66
            ->有効化()
67
            ->無効化()
68
            ->削除();
69
    }
70
71
    public function test_install_remove_local(\AcceptanceTester $I)
72
    {
73
        Horizon_Local::start($I)
74
            ->インストール()
75
            ->削除();
76
    }
77
78
    public function test_install_remove_store(\AcceptanceTester $I)
79
    {
80
        Horizon_Store::start($I)
81
            ->インストール();
82
    }
83
84
    public function test_install_update_remove_store(\AcceptanceTester $I)
85
    {
86
        Horizon_Store::start($I)
87
            ->インストール()
88
            ->アップデート()
89
            ->削除();
90
    }
91
92
93
94
    public function test_install_update_remove_local(\AcceptanceTester $I)
95
    {
96
        Horizon_Local::start($I)
97
            ->インストール()
98
            ->アップデート()
99
            ->削除();
100
    }
101
102
    public function test_install_enable_disable_update_enable_disable_remove_local(\AcceptanceTester $I)
103
    {
104
        Horizon_Local::start($I)
105
            ->インストール()
106
            ->有効化()
107
            ->無効化()
108
            ->アップデート()
109
            ->有効化()
110
            ->無効化()
111
            ->削除();
112
    }
113
114
    public function test_install_enable_disable_update_enable_disable_remove_store(\AcceptanceTester $I)
115
    {
116
        Horizon_Store::start($I)
117
            ->インストール()
118
            ->有効化()
119
            ->無効化()
120
            ->アップデート()
121
            ->有効化()
122
            ->無効化()
123
            ->削除();
124
    }
125
126
    public function test_install_enable_update_disable_remove_store(\AcceptanceTester $I)
127
    {
128
        Horizon_Store::start($I)
129
            ->インストール()
130
            ->有効化()
131
            ->アップデート()
132
            ->無効化()
133
            ->削除();
134
    }
135
136
    public function test_install_enable_update_disable_remove_local(\AcceptanceTester $I)
137
    {
138
        Horizon_Local::start($I)
139
            ->インストール()
140
            ->有効化()
141
            ->アップデート()
142
            ->無効化()
143
            ->削除();
144
    }
145
146
    public function test_install_update_enable_disable_remove_local(\AcceptanceTester $I)
147
    {
148
        Horizon_Local::start($I)
149
            ->インストール()
150
            ->アップデート()
151
            ->有効化()
152
            ->無効化()
153
            ->削除();
154
    }
155
156
    public function test_install_update_enable_disable_remove_store(\AcceptanceTester $I)
157
    {
158
        Horizon_Store::start($I)
159
            ->インストール()
160
            ->アップデート()
161
            ->有効化()
162
            ->無効化()
163
            ->削除();
164
    }
165
166
    public function test_install_enable_enable(\AcceptanceTester $I)
167
    {
168
        Horizon_Store::start($I)
169
            ->インストール()
170
            ->新しいタブで開く()
171
            ->有効化()
172
            ->前のタブに戻る()
173
            ->既に有効なものを有効化();
174
    }
175
176
    public function test_install_disable_disable(\AcceptanceTester $I)
177
    {
178
        Horizon_Store::start($I)
179
            ->インストール()
180
            ->有効化()
181
            ->新しいタブで開く()
182
            ->無効化()
183
            ->前のタブに戻る()
184
            ->既に無効なものを無効化();
185
    }
186
187
    public function test_install_assets_local(\AcceptanceTester $I)
188
    {
189
        $this->publishPlugin('Assets-1.0.0.tgz');
190
191
        $assetsPath = $this->config['plugin_html_realdir'].'/Assets/assets/assets.js';
192
        $updatedPath = $this->config['plugin_html_realdir'].'/Assets/assets/updated.js';
193
194
        $I->assertFileNotExists($assetsPath);
195
        $I->assertFileNotExists($updatedPath);
196
197
        $ManagePage = PluginLocalInstallPage::go($I)->アップロード('plugins/Assets-1.0.0.tgz');
198
        $I->assertFileExists($assetsPath);
199
        $I->assertFileNotExists($updatedPath);
200
201
        $ManagePage->独自プラグイン_有効化('Assets');
202
        $I->assertFileExists($assetsPath);
203
        $I->assertFileNotExists($updatedPath);
204
205
        $ManagePage->独自プラグイン_無効化('Assets');
206
        $I->assertFileExists($assetsPath);
207
        $I->assertFileNotExists($updatedPath);
208
209
        $ManagePage->独自プラグイン_アップデート('Assets', 'plugins/Assets-1.0.1.tgz');
210
        $I->assertFileExists($assetsPath);
211
        $I->assertFileExists($updatedPath);
212
213
        $ManagePage->独自プラグイン_削除('Assets');
214
        $I->assertFileNotExists($assetsPath);
215
        $I->assertFileNotExists($updatedPath);
216
    }
217
218
    public function test_install_assets_store(\AcceptanceTester $I)
219
    {
220
        // 最初のバージョンを作成
221
        $this->publishPlugin('Assets-1.0.0.tgz');
222
223
        $assetsPath = $this->config['plugin_html_realdir'].'/Assets/assets/assets.js';
224
        $updatedPath = $this->config['plugin_html_realdir'].'/Assets/assets/updated.js';
225
        $I->assertFileNotExists($assetsPath);
226
        $I->assertFileNotExists($updatedPath);
227
228
        $ManagePage = PluginSearchPage::go($I)
229
            ->入手する('Assets')
230
            ->インストール();
231
        $I->assertFileNotExists($assetsPath);
232
        $I->assertFileNotExists($updatedPath);
233
234
        $ManagePage->ストアプラグイン_有効化('Assets');
235
        $I->assertFileExists($assetsPath);
236
        $I->assertFileNotExists($updatedPath);
237
238
        $ManagePage->ストアプラグイン_無効化('Assets');
239
        $I->assertFileExists($assetsPath);
240
        $I->assertFileNotExists($updatedPath);
241
242
        // 新しいバージョンを作成
243
        $this->publishPlugin('Assets-1.0.1.tgz');
244
245
        $I->reloadPage();
246
        $ManagePage->ストアプラグイン_アップデート('Assets')->アップデート();
247
        $I->assertFileExists($assetsPath);
248
        $I->assertFileExists($updatedPath);
249
250
        $ManagePage->ストアプラグイン_削除('Assets');
251
        $I->assertFileNotExists($assetsPath);
252
        $I->assertFileNotExists($updatedPath);
253
    }
254
255
    public function test_extend_same_table_store(\AcceptanceTester $I)
256
    {
257
        $Horizon = Horizon_Store::start($I);
258
        $Boomerang = Boomerang_Store::start($I);
259
260
        $Horizon->インストール()->有効化();
261
        $Boomerang->インストール()->有効化();
262
263
        $Horizon->tableExists();
264
        $Horizon->columnExists();
265
266
        $Horizon->無効化()->削除();
267
268
        $Boomerang->tableExists();
269
        $Boomerang->columnExists();
270
        $Boomerang->traitExists();
271
272
        $Boomerang->無効化()->削除();
273
    }
274
275 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...
276
    {
277
        $Horizon = Horizon_Local::start($I);
278
        $Boomerang = Boomerang_Local::start($I);
279
280
        $Horizon->インストール()->有効化();
281
        $Boomerang->インストール()->有効化();
282
283
        $Horizon->tableExists();
284
        $Horizon->columnExists();
285
    }
286
287 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...
288
    {
289
        $Horizon = Horizon_Local::start($I);
290
        $Boomerang = Boomerang_Local::start($I);
291
292
        $Horizon->インストール()->有効化()->無効化();
293
        $Boomerang->インストール()->有効化();
294
295
        $Horizon->tableExists();
296
        $Horizon->columnExists();
297
    }
298
299
    private function publishPlugin($fileName)
300
    {
301
        copy(codecept_data_dir().'/'.'plugins/'.$fileName, codecept_root_dir().'/repos/'.$fileName);
302
    }
303
}
304
305
abstract class Abstract_Plugin
306
{
307
    /** @var AcceptanceTester */
308
    protected $I;
309
310
    /** @var EntityManager */
311
    protected $em;
312
313
    /** @var \Doctrine\DBAL\Connection */
314
    protected $conn;
315
316
    /** @var PluginRepository */
317
    protected $pluginRepository;
318
319
    /** @var EccubeConfig */
320
    protected $config;
321
322
    protected $initialized = false;
323
324
    protected $enabled = false;
325
326
    protected $removed = false;
327
328
    protected $table;
329
330
    protected $column;
331
332
    protected $traitTarget;
333
334
    protected $trait;
335
336
    public function __construct(\AcceptanceTester $I)
337
    {
338
        $this->I = $I;
339
        $this->em = Fixtures::get('entityManager');
340
        $this->conn = $this->em->getConnection();
341
        $this->pluginRepository = $this->em->getRepository(Plugin::class);
342
        $this->config = Fixtures::get('config');
343
    }
344
345 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...
346
    {
347
        if ($this->table) {
348
            $exists = $this->conn->executeQuery("SELECT count(*) AS count FROM information_schema.columns WHERE table_name = '".$this->table."';")->fetch()['count'] > 0;
349
            $this->I->assertTrue($exists, 'テーブルがあるはず '.$this->table);
350
        }
351
    }
352
353 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...
354
    {
355
        if ($this->table) {
356
            $exists = $this->conn->executeQuery("SELECT count(*) AS count FROM information_schema.columns WHERE table_name = '".$this->table."';")->fetch()['count'] > 0;
357
            $this->I->assertFalse($exists, 'テーブルがないはず '.$this->table);
358
        }
359
    }
360
361 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...
362
    {
363
        if ($this->column) {
364
            list($tableName, $columnName) = explode('.', $this->column);
365
            $exists = $this->conn->executeQuery("SELECT count(*) AS count FROM information_schema.columns WHERE table_name = '${tableName}' AND column_name = '${columnName}';")->fetch()['count'] == 1;
366
            $this->I->assertTrue($exists, 'カラムがあるはず '.$this->column);
367
        }
368
    }
369
370 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...
371
    {
372
        if ($this->column) {
373
            list($tableName, $columnName) = explode('.', $this->column);
374
            $exists = $this->conn->executeQuery("SELECT count(*) AS count FROM information_schema.columns WHERE table_name = '${tableName}' AND column_name = '${columnName}';")->fetch()['count'] == 1;
375
            $this->I->assertFalse($exists, 'カラムがないはず '.$this->column);
376
        }
377
    }
378
379
    public function traitExists()
380
    {
381
        if ($this->trait) {
382
            $this->I->assertContains($this->trait, file_get_contents($this->config['kernel.project_dir'].'/app/proxy/entity/'.$this->traitTarget.'.php'), 'Traitがあるはず');
383
        }
384
    }
385
386
    public function traitNotExists()
387
    {
388
        if ($this->trait) {
389
            $file = $this->config['kernel.project_dir'].'/app/proxy/entity/'.$this->traitTarget.'.php';
390
            if (file_exists($file)) {
391
                $this->I->assertNotContains($this->trait, file_get_contents($file), 'Traitがないはず');
392
            } else {
393
                $this->I->assertTrue(true, 'Traitがないはず');
394
            }
395
        }
396
    }
397
398
    public function 新しいタブで開く()
399
    {
400
        $this->I->executeJS("window.open(location.href, 'other')");
401
        $this->I->switchToWindow('other');
402
        return $this;
403
    }
404
405
    public function 前のタブに戻る()
406
    {
407
        $this->I->switchToPreviousTab();
408
        return $this;
409
    }
410
411
    public function 検証()
412
    {
413
        if ($this->initialized) {
414
            $this->tableExists();
415
            $this->columnExists();
416
        } else {
417
            $this->tableNotExists();
418
            $this->columnNotExists();
419
        }
420
421
        if ($this->enabled) {
422
            $this->traitExists();
423
        } else {
424
            $this->traitNotExists();
425
        }
426
    }
427
}
428
429
class Store_Plugin extends Abstract_Plugin
430
{
431
    /** @var PluginManagePage */
432
    private $ManagePage;
433
434
    /** @var Plugin */
435
    private $Plugin;
436
437
    private $code;
438
439
    public function __construct(AcceptanceTester $I, $code)
440
    {
441
        parent::__construct($I);
442
        $this->code = $code;
443
        $this->publishPlugin($this->code.'-1.0.0.tgz');
444
    }
445
446
    public function インストール()
447
    {
448
        /*
449
         * インストール
450
         */
451
        $this->ManagePage = PluginSearchPage::go($this->I)
452
            ->入手する($this->code)
453
            ->インストール();
454
455
        $this->検証();
456
457
        $this->Plugin = $this->pluginRepository->findByCode($this->code);
458
        $this->I->assertFalse($this->Plugin->isInitialized(), '初期化されていない');
459
        $this->I->assertFalse($this->Plugin->isEnabled(), '有効化されていない');
460
461
        return $this;
462
    }
463
464 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...
465
    {
466
        $this->ManagePage->ストアプラグイン_有効化($this->code);
467
468
        $this->initialized = true;
469
        $this->enabled = true;
470
471
        $this->検証();
472
473
        $this->em->refresh($this->Plugin);
474
        $this->I->assertTrue($this->Plugin->isInitialized(), '初期化されている');
475
        $this->I->assertTrue($this->Plugin->isEnabled(), '有効化されている');
476
        return $this;
477
    }
478
479
    public function 既に有効なものを有効化()
480
    {
481
        $this->ManagePage->ストアプラグイン_有効化($this->code, '既に有効です。');
482
483
        $this->initialized = true;
484
        $this->enabled = true;
485
486
        $this->検証();
487
488
        $this->em->refresh($this->Plugin);
489
        $this->I->assertTrue($this->Plugin->isInitialized(), '初期化されている');
490
        $this->I->assertTrue($this->Plugin->isEnabled(), '有効化されている');
491
492
493
        return $this;
494
    }
495
496
    public function 無効化()
497
    {
498
        $this->ManagePage->ストアプラグイン_無効化($this->code);
499
500
        $this->enabled = false;
501
502
        $this->検証();
503
504
        $this->em->refresh($this->Plugin);
505
        $this->I->assertTrue($this->Plugin->isInitialized(), '初期化されている');
506
        $this->I->assertFalse($this->Plugin->isEnabled(), '無効化されている');
507
508
        return $this;
509
    }
510
511
    public function 既に無効なものを無効化()
512
    {
513
        $this->ManagePage->ストアプラグイン_無効化($this->code, '既に無効です。');
514
515
        $this->enabled = false;
516
517
        $this->検証();
518
519
        $this->em->refresh($this->Plugin);
520
        $this->I->assertTrue($this->Plugin->isInitialized(), '初期化されている');
521
        $this->I->assertFalse($this->Plugin->isEnabled(), '無効化されている');
522
523
        return $this;
524
    }
525
526 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...
527
    {
528
        $this->ManagePage->ストアプラグイン_削除($this->code);
529
530
        $this->initialized = false;
531
        $this->enabled = false;
532
533
        $this->検証();
534
535
        $this->em->refresh($this->Plugin);
536
        $this->Plugin = $this->pluginRepository->findByCode($this->code);
537
        $this->I->assertNull($this->Plugin, '削除されている');
538
539
        return $this;
540
    }
541
542
    public function アップデート()
543
    {
544
        $this->publishPlugin($this->code.'-1.0.1.tgz');
545
546
        $this->I->reloadPage();
547
        $this->ManagePage->ストアプラグイン_アップデート($this->code)->アップデート();
548
549
        $this->検証();
550
551
        $this->em->refresh($this->Plugin);
552
        $this->I->assertEquals($this->initialized, $this->Plugin->isInitialized(), '初期化');
553
        $this->I->assertEquals($this->enabled, $this->Plugin->isEnabled(), '有効/無効');
554
555
        return $this;
556
    }
557
558
    private function publishPlugin($fileName)
559
    {
560
        $published = copy(codecept_data_dir().'/'.'plugins/'.$fileName, codecept_root_dir().'/repos/'.$fileName);
561
        $this->I->assertTrue($published, "公開できた ${fileName}");
562
        $output = [];
563
        exec("ls -ltra repos/", $output);
564
        echo implode(PHP_EOL, $output).PHP_EOL;
565
    }
566
}
567
568
class Local_Plugin extends Abstract_Plugin
569
{
570
    /** @var PluginManagePage */
571
    private $ManagePage;
572
573
    /** @var Plugin */
574
    private $Plugin;
575
576
    /** @var string */
577
    private $code;
578
579
    public function __construct(AcceptanceTester $I, $code)
580
    {
581
        parent::__construct($I);
582
        $this->code = $code;
583
    }
584
585
    public function インストール()
586
    {
587
        $this->ManagePage = PluginLocalInstallPage::go($this->I)
588
            ->アップロード('plugins/'.$this->code.'-1.0.0.tgz');
589
590
        $this->initialized = true;
591
592
        $this->I->see('プラグインをインストールしました。', PluginManagePage::完了メーッセージ);
593
594
        $this->検証();
595
596
        $this->Plugin = $this->pluginRepository->findByCode($this->code);
597
        $this->I->assertTrue($this->Plugin->isInitialized(), '初期化されていない');
598
        $this->I->assertFalse($this->Plugin->isEnabled(), '有効化されていない');
599
600
        return $this;
601
    }
602
603
    public function 有効化()
604
    {
605
        $this->ManagePage->独自プラグイン_有効化($this->code);
606
607
        $this->enabled = true;
608
609
        $this->検証();
610
611
        $this->em->refresh($this->Plugin);
612
        $this->I->assertTrue($this->Plugin->isInitialized(), '初期化されている');
613
        $this->I->assertTrue($this->Plugin->isEnabled(), '有効化されている');
614
        return $this;
615
    }
616
617
    public function 無効化()
618
    {
619
        $this->ManagePage->独自プラグイン_無効化($this->code);
620
621
        $this->enabled = false;
622
623
        $this->検証();
624
625
        $this->em->refresh($this->Plugin);
626
        $this->I->assertTrue($this->Plugin->isInitialized(), '初期化されている');
627
        $this->I->assertFalse($this->Plugin->isEnabled(), '無効化されている');
628
629
        return $this;
630
    }
631
632 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...
633
    {
634
        $this->ManagePage->独自プラグイン_削除($this->code);
635
636
        $this->initialized = false;
637
        $this->enabled = false;
638
639
        $this->I->see('プラグインを削除しました。', PluginManagePage::完了メーッセージ);
640
641
        $this->検証();
642
643
        $this->em->refresh($this->Plugin);
644
        $this->Plugin = $this->pluginRepository->findByCode($this->code);
645
        $this->I->assertNull($this->Plugin, '削除されている');
646
647
        return $this;
648
    }
649
650
    public function アップデート()
651
    {
652
        $this->ManagePage->独自プラグイン_アップデート($this->code, 'plugins/'.$this->code.'-1.0.1.tgz');
653
654
        $this->検証();
655
656
        $this->em->refresh($this->Plugin);
657
        $this->I->assertTrue($this->Plugin->isInitialized(), '初期化されている');
658
        $this->I->assertEquals($this->enabled, $this->Plugin->isEnabled(), '有効/無効');
659
660
        return $this;
661
    }
662
}
663
664 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...
665
{
666
    public function __construct(AcceptanceTester $I)
667
    {
668
        parent::__construct($I, 'Horizon');
669
        $this->table = 'dtb_dash';
670
        $this->column = 'dtb_cart.is_horizon';
671
        $this->trait = '\Plugin\Horizon\Entity\CartTrait';
672
        $this->traitTarget = 'Cart';
673
    }
674
675
    public static function start(AcceptanceTester $I)
676
    {
677
        return new self($I);
678
    }
679
}
680
681 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...
682
{
683
    public function __construct(AcceptanceTester $I)
684
    {
685
        parent::__construct($I, 'Horizon');
686
        $this->table = 'dtb_dash';
687
        $this->column = 'dtb_cart.is_horizon';
688
        $this->trait = '\Plugin\Horizon\Entity\CartTrait';
689
        $this->traitTarget = 'Cart';
690
    }
691
692
    public static function start(AcceptanceTester $I)
693
    {
694
        return new self($I);
695
    }
696
}
697
698 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...
699
{
700
    public function __construct(AcceptanceTester $I)
701
    {
702
        parent::__construct($I, 'Boomerang');
703
        $this->column = 'dtb_cart.is_boomerang';
704
        $this->trait = '\Plugin\Boomerang\Entity\CartTrait';
705
        $this->traitTarget = 'Cart';
706
    }
707
708
    public static function start(AcceptanceTester $I)
709
    {
710
        return new self($I);
711
    }
712
}
713
714 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...
715
{
716
    public function __construct(AcceptanceTester $I)
717
    {
718
        parent::__construct($I, 'Boomerang');
719
        $this->column = 'dtb_cart.is_boomerang';
720
        $this->trait = '\Plugin\Boomerang\Entity\CartTrait';
721
        $this->traitTarget = 'Cart';
722
    }
723
724
    public static function start(AcceptanceTester $I)
725
    {
726
        return new self($I);
727
    }
728
}