Code Duplication    Length = 20-20 lines in 2 locations

tests/RenderTest.php 1 location

@@ 28-47 (lines=20) @@
25
            $factory->url = url('/');
26
            $factory->linkAttributes->push(['class' => 'menu-link']);
27
        });
28
        $builder->create('orders', SubMenu::class, function(SubMenuFactory $factory) {
29
            $factory->attributes->push(['class' => 'child-menu']);
30
            $factory->title = 'Orders';
31
            $factory->url = 'javascript:;';
32
33
            $factory->builder->create('all', Link::class, function(LinkFactory $factory) {
34
                $factory->title = 'All';
35
                $factory->url = url('/orders/all');
36
            });
37
            $factory->builder->create('type_1', Link::class, function(LinkFactory $factory) {
38
                $factory->title = 'Type 1';
39
                $factory->url = url('/orders/1');
40
                $factory->linkAttributes->push(['class' => 'text-color-red']);
41
            });
42
            $factory->builder->create('type_2', Link::class, function(LinkFactory $factory) {
43
                $factory->title = 'Type 2';
44
                $factory->url = url('/orders/2');
45
                $factory->linkAttributes->push(['data-attribute' => 'value']);
46
            });
47
        });
48
49
        return $builder;
50
    }

tests/BuilderTest.php 1 location

@@ 243-262 (lines=20) @@
240
            $factory->linkAttributes->push(['class' => 'menu-link']);
241
        });
242
        
243
        $builder->create('orders', SubMenu::class, function(SubMenuFactory $factory) {
244
            $factory->attributes->push(['class' => 'child-menu']);
245
            $factory->title = 'Orders';
246
            $factory->url = 'javascript:;';
247
            
248
            $factory->builder->create('all', Link::class, function(LinkFactory $factory) {
249
                $factory->title = 'All';
250
                $factory->url = url('/orders/all');
251
            });
252
            $factory->builder->create('type_1', Link::class, function(LinkFactory $factory) {
253
                $factory->title = 'Type 1';
254
                $factory->url = url('/orders/1');
255
                $factory->linkAttributes->push(['class' => 'text-color-red']);
256
            });
257
            $factory->builder->create('type_2', Link::class, function(LinkFactory $factory) {
258
                $factory->title = 'Type 2';
259
                $factory->url = url('/orders/2');
260
                $factory->linkAttributes->push(['data-attribute' => 'value']);
261
            });
262
        });
263
        
264
        $html = $builder->render();
265