Code Duplication    Length = 20-20 lines in 2 locations

tests/BuilderTest.php 1 location

@@ 232-251 (lines=20) @@
229
            $factory->linkAttributes->push(['class' => 'menu-link']);
230
        });
231
        
232
        $builder->create('orders', SubMenu::class, function(SubMenuFactory $factory) {
233
            $factory->attributes->push(['class' => 'child-menu']);
234
            $factory->title = 'Orders';
235
            $factory->url = 'javascript:;';
236
            
237
            $factory->builder->create('all', Link::class, function(LinkFactory $factory) {
238
                $factory->title = 'All';
239
                $factory->url = url('/orders/all');
240
            });
241
            $factory->builder->create('type_1', Link::class, function(LinkFactory $factory) {
242
                $factory->title = 'Type 1';
243
                $factory->url = url('/orders/1');
244
                $factory->linkAttributes->push(['class' => 'text-color-red']);
245
            });
246
            $factory->builder->create('type_2', Link::class, function(LinkFactory $factory) {
247
                $factory->title = 'Type 2';
248
                $factory->url = url('/orders/2');
249
                $factory->linkAttributes->push(['data-attribute' => 'value']);
250
            });
251
        });
252
        
253
        $html = $builder->render();
254
        

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
    }