WriteBrowserFile::writeTest()   A
last analyzed

Complexity

Conditions 1
Paths 1

Size

Total Lines 13
Code Lines 6

Duplication

Lines 13
Ratio 100 %

Code Coverage

Tests 7
CRAP Score 1

Importance

Changes 0
Metric Value
c 0
b 0
f 0
dl 13
loc 13
ccs 7
cts 7
cp 1
rs 9.4285
cc 1
eloc 6
nc 1
nop 3
crap 1
1
<?php
2
3
namespace GD\Helpers;
4
5 View Code Duplication
class WriteBrowserFile extends WriteFileBase
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...
6
{
7
8
    protected $spacing = "    ";
9
10 6
    public function writeTest($path, $name, $dusk_class_and_methods)
11
    {
12
13 6
        $this->write_class_name = $name;
14
15 6
        $this->write_destination_folder_path = $path;
16
17 6
        $this->checkDestinationTestFolder();
18
19 6
        $this->convertDuskClassAndMethodsArrayToText($dusk_class_and_methods);
20
21 6
        $this->saveToFile();
22 6
    }
23
24 6
    protected function getAndSetHeaderArea()
25
    {
26 6
        $path = __DIR__ . '/../../stubs/browser_header.txt';
27 6
        $this->content = $this->getFilesystem()->get($path);
28
29 6
        parent::getAndSetHeaderArea();
30 6
    }
31
32 6
    protected function getAndSetFooterArea()
33
    {
34 6
        $path = __DIR__ . '/../../stubs/browser_footer.txt';
35 6
        $content = $this->getFilesystem()->get($path);
36
37 6
        $this->dusk_class_and_methods_string = $this->dusk_class_and_methods_string . $content;
38 6
    }
39
40 6
    protected function addParentContent($parent_function)
41
    {
42 6
        $parent_base = __DIR__ . '/../../stubs/browser_parent.txt';
43 6
        $this->base = $this->getFilesystem()->get($parent_base);
44
45 6
        parent::addParentContent($parent_function);
46 6
    }
47
48 6
    protected function addSteps(array $steps)
49
    {
50 6
        $path = __DIR__ . '/../../stubs/browser_step.txt';
51 6
        $this->step_template = $this->getFilesystem()->get($path);
52
53 6
        parent::addSteps($steps);
54 6
    }
55
}
56