Completed
Push — dev/plugin-misc ( 80e15a...5b9e26 )
by Kiyotaka
05:50
created

EA10PluginCest::test_install_remove_store()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 5

Duplication

Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
cc 1
nc 1
nop 1
dl 0
loc 5
rs 10
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 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...
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
267 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...
268
    {
269
        $Horizon = Horizon_Local::start($I);
270
        $Boomerang = Boomerang_Local::start($I);
271
272
        $Horizon->インストール()->有効化();
273
        $Boomerang->インストール()->有効化();
274
275
        $Horizon->tableExists();
276
        $Horizon->columnExists();
277
    }
278
279 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...
280
    {
281
        $Horizon = Horizon_Local::start($I);
282
        $Boomerang = Boomerang_Local::start($I);
283
284
        $Horizon->インストール()->有効化()->無効化();
285
        $Boomerang->インストール()->有効化();
286
287
        $Horizon->tableExists();
288
        $Horizon->columnExists();
289
    }
290
291
    private function publishPlugin($fileName)
292
    {
293
        copy(codecept_data_dir().'/'.'plugins/'.$fileName, codecept_root_dir().'/repos/'.$fileName);
294
    }
295
}
296
297
abstract class Abstract_Plugin
298
{
299
    /** @var AcceptanceTester */
300
    protected $I;
301
302
    /** @var EntityManager */
303
    protected $em;
304
305
    /** @var \Doctrine\DBAL\Connection */
306
    protected $conn;
307
308
    /** @var PluginRepository */
309
    protected $pluginRepository;
310
311
    /** @var EccubeConfig */
312
    protected $config;
313
314
315
    protected $table;
316
317
    protected $column;
318
319
    protected $traitTarget;
320
321
    protected $trait;
322
323
    public function __construct(\AcceptanceTester $I)
324
    {
325
        $this->I = $I;
326
        $this->em = Fixtures::get('entityManager');
327
        $this->conn = $this->em->getConnection();
328
        $this->pluginRepository = $this->em->getRepository(Plugin::class);
329
        $this->config = Fixtures::get('config');
330
    }
331
332 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...
333
    {
334
        if ($this->table) {
335
            $exists = $this->conn->executeQuery("SELECT count(*) AS count FROM information_schema.columns WHERE table_name = '".$this->table."';")->fetch()['count'] > 0;
336
            $this->I->assertTrue($exists, 'テーブルがあるはず '.$this->table);
337
        }
338
    }
339
340 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...
341
    {
342
        if ($this->table) {
343
            $exists = $this->conn->executeQuery("SELECT count(*) AS count FROM information_schema.columns WHERE table_name = '".$this->table."';")->fetch()['count'] > 0;
344
            $this->I->assertFalse($exists, 'テーブルがないはず '.$this->table);
345
        }
346
    }
347
348 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...
349
    {
350
        if ($this->column) {
351
            list($tableName, $columnName) = explode('.', $this->column);
352
            $exists = $this->conn->executeQuery("SELECT count(*) AS count FROM information_schema.columns WHERE table_name = '${tableName}' AND column_name = '${columnName}';")->fetch()['count'] == 1;
353
            $this->I->assertTrue($exists, 'カラムがあるはず '.$this->column);
354
        }
355
    }
356
357 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...
358
    {
359
        if ($this->column) {
360
            list($tableName, $columnName) = explode('.', $this->column);
361
            $exists = $this->conn->executeQuery("SELECT count(*) AS count FROM information_schema.columns WHERE table_name = '${tableName}' AND column_name = '${columnName}';")->fetch()['count'] == 1;
362
            $this->I->assertFalse($exists, 'カラムがないはず '.$this->column);
363
        }
364
    }
365
366
    public function traitExists()
367
    {
368
        if ($this->trait) {
369
            $this->I->assertContains($this->trait, file_get_contents($this->config['kernel.project_dir'].'/app/proxy/entity/'.$this->traitTarget.'.php'), 'Traitがあるはず');
370
        }
371
    }
372
373
    public function traitNotExists()
374
    {
375
        if ($this->trait) {
376
            $file = $this->config['kernel.project_dir'].'/app/proxy/entity/'.$this->traitTarget.'.php';
377
            if (file_exists($file)) {
378
                $this->I->assertNotContains($this->trait, file_get_contents($file), 'Traitがないはず');
379
            } else {
380
                $this->I->assertTrue(true, 'Traitがないはず');
381
            }
382
        }
383
    }
384
385
    public function 新しいタブで開く()
386
    {
387
        $this->I->executeJS("window.open(location.href, 'other')");
388
        $this->I->switchToWindow('other');
389
        return $this;
390
    }
391
392
    public function 前のタブに戻る()
393
    {
394
        $this->I->switchToPreviousTab();
395
        return $this;
396
    }
397
}
398
399
class Store_Plugin extends Abstract_Plugin
400
{
401
    /** @var PluginManagePage */
402
    private $ManagePage;
403
404
    /** @var Plugin */
405
    private $Plugin;
406
407
    private $initialized = false;
408
409
    private $enabled = false;
410
411
    private $code;
412
413
    public function __construct(AcceptanceTester $I, $code)
414
    {
415
        parent::__construct($I);
416
        $this->code = $code;
417
        $this->publishPlugin($this->code.'-1.0.0.tgz');
418
    }
419
420
    public function インストール()
421
    {
422
        /*
423
         * インストール
424
         */
425
        $this->ManagePage = PluginSearchPage::go($this->I)
426
            ->入手する($this->code)
427
            ->インストール();
428
429
        $this->tableNotExists();
430
        $this->columnNotExists();
431
432
        $this->traitNotExists();
433
434
        $this->Plugin = $this->pluginRepository->findByCode($this->code);
435
        $this->I->assertFalse($this->Plugin->isInitialized(), '初期化されていない');
436
        $this->I->assertFalse($this->Plugin->isEnabled(), '有効化されていない');
437
438
        return $this;
439
    }
440
441
    public function 有効化()
442
    {
443
        $this->ManagePage->ストアプラグイン_有効化($this->code);
444
445
        $this->tableExists();
446
        $this->columnExists();
447
448
        $this->traitExists();
449
450
        $this->em->refresh($this->Plugin);
451
        $this->I->assertTrue($this->Plugin->isInitialized(), '初期化されている');
452
        $this->I->assertTrue($this->Plugin->isEnabled(), '有効化されている');
453
454
        $this->initialized = true;
455
        $this->enabled = true;
456
        return $this;
457
    }
458
459
    public function 既に有効なものを有効化()
460
    {
461
        $this->ManagePage->ストアプラグイン_有効化($this->code, '既に有効です。');
462
463
        $this->tableExists();
464
        $this->columnExists();
465
466
        $this->traitExists();
467
468
        $this->em->refresh($this->Plugin);
469
        $this->I->assertTrue($this->Plugin->isInitialized(), '初期化されている');
470
        $this->I->assertTrue($this->Plugin->isEnabled(), '有効化されている');
471
472
        $this->initialized = true;
473
        $this->enabled = true;
474
475
476
        return $this;
477
    }
478
479 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...
480
    {
481
        $this->ManagePage->ストアプラグイン_無効化($this->code);
482
483
        $this->tableExists();
484
        $this->columnExists();
485
486
        $this->traitNotExists();
487
488
        $this->em->refresh($this->Plugin);
489
        $this->I->assertTrue($this->Plugin->isInitialized(), '初期化されている');
490
        $this->I->assertFalse($this->Plugin->isEnabled(), '無効化されている');
491
492
        $this->enabled = false;
493
494
        return $this;
495
    }
496
497
    public function 既に無効なものを無効化()
498
    {
499
        $this->ManagePage->ストアプラグイン_無効化($this->code, '既に無効です。');
500
501
        $this->tableExists();
502
        $this->columnExists();
503
504
        $this->traitNotExists();
505
506
        $this->em->refresh($this->Plugin);
507
        $this->I->assertTrue($this->Plugin->isInitialized(), '初期化されている');
508
        $this->I->assertFalse($this->Plugin->isEnabled(), '無効化されている');
509
510
        $this->enabled = false;
511
512
        return $this;
513
    }
514
515 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...
516
    {
517
        $this->ManagePage->ストアプラグイン_削除($this->code);
518
519
        $this->tableNotExists();
520
        $this->columnNotExists();
521
522
        $this->traitNotExists();
523
524
        $this->em->refresh($this->Plugin);
525
        $this->Plugin = $this->pluginRepository->findByCode($this->code);
526
        $this->I->assertNull($this->Plugin, '削除されている');
527
528
        return $this;
529
    }
530
531
    public function アップデート()
532
    {
533
        $this->publishPlugin($this->code.'-1.0.1.tgz');
534
535
        $this->I->reloadPage();
536
        $this->ManagePage->ストアプラグイン_アップデート($this->code)->アップデート();
537
538
        if ($this->initialized) {
539
            $this->tableExists();
540
            $this->columnExists();
541
            $this->traitExists();
542
        } else {
543
            $this->tableNotExists();
544
            $this->columnNotExists();
545
            $this->traitNotExists();
546
        }
547
548
        $this->em->refresh($this->Plugin);
549
        $this->I->assertEquals($this->initialized, $this->Plugin->isInitialized(), '初期化');
550
        $this->I->assertEquals($this->enabled, $this->Plugin->isEnabled(), '有効/無効');
551
552
        return $this;
553
    }
554
555
    private function publishPlugin($fileName)
556
    {
557
        $published = copy(codecept_data_dir().'/'.'plugins/'.$fileName, codecept_root_dir().'/repos/'.$fileName);
558
        $this->I->assertTrue($published, "公開できた ${fileName}");
559
        $output = [];
560
        exec("ls -ltra repos/", $output);
561
        echo implode(PHP_EOL, $output).PHP_EOL;
562
    }
563
}
564
565
class Local_Plugin extends Abstract_Plugin
566
{
567
    /** @var PluginManagePage */
568
    private $ManagePage;
569
570
    /** @var Plugin */
571
    private $Plugin;
572
573
    private $enabled = false;
574
575
    /** @var string */
576
    private $code;
577
578
    public function __construct(AcceptanceTester $I, $code)
579
    {
580
        parent::__construct($I);
581
        $this->code = $code;
582
    }
583
584
    public function インストール()
585
    {
586
        $this->ManagePage = PluginLocalInstallPage::go($this->I)
587
            ->アップロード('plugins/'.$this->code.'-1.0.0.tgz');
588
589
        $this->I->see('プラグインをインストールしました。', PluginManagePage::完了メーッセージ);
590
591
        $this->tableExists();
592
        $this->columnExists();
593
594
        $this->traitNotExists();
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->tableExists();
608
        $this->columnExists();
609
610
        $this->traitExists();
611
612
        $this->em->refresh($this->Plugin);
613
        $this->I->assertTrue($this->Plugin->isInitialized(), '初期化されている');
614
        $this->I->assertTrue($this->Plugin->isEnabled(), '有効化されている');
615
616
        $this->enabled = true;
617
        return $this;
618
    }
619
620 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...
621
    {
622
        $this->ManagePage->独自プラグイン_無効化($this->code);
623
624
        $this->tableExists();
625
        $this->columnExists();
626
627
        $this->traitNotExists();
628
629
        $this->em->refresh($this->Plugin);
630
        $this->I->assertTrue($this->Plugin->isInitialized(), '初期化されている');
631
        $this->I->assertFalse($this->Plugin->isEnabled(), '無効化されている');
632
633
        $this->enabled = false;
634
635
        return $this;
636
    }
637
638 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...
639
    {
640
        $this->ManagePage->独自プラグイン_削除($this->code);
641
642
        $this->I->see('プラグインを削除しました。', PluginManagePage::完了メーッセージ);
643
644
        $this->tableNotExists();
645
        $this->columnNotExists();
646
647
        $this->traitNotExists();
648
649
        $this->em->refresh($this->Plugin);
650
        $this->Plugin = $this->pluginRepository->findByCode($this->code);
651
        $this->I->assertNull($this->Plugin, '削除されている');
652
653
        return $this;
654
    }
655
656
    public function アップデート()
657
    {
658
        $this->ManagePage->独自プラグイン_アップデート($this->code, 'plugins/'.$this->code.'-1.0.1.tgz');
659
660
        $this->tableExists();
661
        $this->columnExists();
662
663
        $this->traitExists();
664
665
        $this->em->refresh($this->Plugin);
666
        $this->I->assertTrue($this->Plugin->isInitialized(), '初期化されている');
667
        $this->I->assertEquals($this->enabled, $this->Plugin->isEnabled(), '有効/無効');
668
669
        return $this;
670
    }
671
}
672
673 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...
674
{
675
    public function __construct(AcceptanceTester $I)
676
    {
677
        parent::__construct($I, 'Horizon');
678
        $this->table = 'dtb_dash';
679
        $this->column = 'dtb_cart.is_horizon';
680
        $this->trait = '\Plugin\Horizon\Entity\CartTrait';
681
        $this->traitTarget = 'Cart';
682
    }
683
684
    public static function start(AcceptanceTester $I)
685
    {
686
        return new self($I);
687
    }
688
}
689
690 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...
691
{
692
    public function __construct(AcceptanceTester $I)
693
    {
694
        parent::__construct($I, 'Horizon');
695
        $this->table = 'dtb_dash';
696
        $this->column = 'dtb_cart.is_horizon';
697
        $this->trait = '\Plugin\Horizon\Entity\CartTrait';
698
        $this->traitTarget = 'Cart';
699
    }
700
701
    public static function start(AcceptanceTester $I)
702
    {
703
        return new self($I);
704
    }
705
}
706
707 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...
708
{
709
    public function __construct(AcceptanceTester $I)
710
    {
711
        parent::__construct($I, 'Boomerang');
712
        $this->column = 'dtb_cart.is_boomerang';
713
        $this->trait = '\Plugin\Boomerang\Entity\CartTrait';
714
        $this->traitTarget = 'Cart';
715
    }
716
717
    public static function start(AcceptanceTester $I)
718
    {
719
        return new self($I);
720
    }
721
}
722
723 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...
724
{
725
    public function __construct(AcceptanceTester $I)
726
    {
727
        parent::__construct($I, 'Boomerang');
728
        $this->column = 'dtb_cart.is_boomerang';
729
        $this->trait = '\Plugin\Boomerang\Entity\CartTrait';
730
        $this->traitTarget = 'Cart';
731
    }
732
733
    public static function start(AcceptanceTester $I)
734
    {
735
        return new self($I);
736
    }
737
}