| @@ 5-53 (lines=49) @@ | ||
| 2 | ||
| 3 | namespace GD\Helpers; |
|
| 4 | ||
| 5 | class WriteBrowserFile extends WriteFileBase |
|
| 6 | { |
|
| 7 | ||
| 8 | public function writeTest($path, $name, $dusk_class_and_methods) |
|
| 9 | { |
|
| 10 | ||
| 11 | $this->write_class_name = $name; |
|
| 12 | ||
| 13 | $this->write_destination_folder_path = $path; |
|
| 14 | ||
| 15 | $this->checkDestinationTestFolder(); |
|
| 16 | ||
| 17 | $this->convertDuskClassAndMethodsArrayToText($dusk_class_and_methods); |
|
| 18 | ||
| 19 | $this->saveToFile(); |
|
| 20 | } |
|
| 21 | ||
| 22 | protected function addParentContent($parent_function) |
|
| 23 | { |
|
| 24 | $parent_base = __DIR__ . '/../../stubs/browser_parent.txt'; |
|
| 25 | $this->base = $this->getFilesystem()->get($parent_base); |
|
| 26 | ||
| 27 | parent::addParentContent($parent_function); |
|
| 28 | } |
|
| 29 | ||
| 30 | protected function addSteps(array $steps) |
|
| 31 | { |
|
| 32 | $path = __DIR__ . '/../../stubs/browser_step.txt'; |
|
| 33 | $this->step_template = $this->getFilesystem()->get($path); |
|
| 34 | ||
| 35 | parent::addSteps($steps); |
|
| 36 | } |
|
| 37 | ||
| 38 | protected function getAndSetHeaderArea() |
|
| 39 | { |
|
| 40 | $path = __DIR__ . '/../../stubs/browser_header.txt'; |
|
| 41 | $this->content = $this->getFilesystem()->get($path); |
|
| 42 | ||
| 43 | parent::getAndSetHeaderArea(); |
|
| 44 | } |
|
| 45 | ||
| 46 | protected function getAndSetFooterArea() |
|
| 47 | { |
|
| 48 | $path = __DIR__ . '/../../stubs/browser_footer.txt'; |
|
| 49 | $content = $this->getFilesystem()->get($path); |
|
| 50 | ||
| 51 | $this->dusk_class_and_methods_string = $this->dusk_class_and_methods_string . $content; |
|
| 52 | } |
|
| 53 | } |
|
| 54 | ||
| @@ 5-53 (lines=49) @@ | ||
| 2 | ||
| 3 | namespace GD\Helpers; |
|
| 4 | ||
| 5 | class WritePHPUnitFile extends WriteFileBase |
|
| 6 | { |
|
| 7 | ||
| 8 | public function writeTest($path, $name, $dusk_class_and_methods) |
|
| 9 | { |
|
| 10 | ||
| 11 | $this->write_class_name = $name; |
|
| 12 | ||
| 13 | $this->write_destination_folder_path = $path; |
|
| 14 | ||
| 15 | $this->checkDestinationTestFolder(); |
|
| 16 | ||
| 17 | $this->convertDuskClassAndMethodsArrayToText($dusk_class_and_methods); |
|
| 18 | ||
| 19 | $this->saveToFile(); |
|
| 20 | } |
|
| 21 | ||
| 22 | protected function addParentContent($parent_function) |
|
| 23 | { |
|
| 24 | $parent_base = __DIR__ . '/../../stubs/parent.txt'; |
|
| 25 | $this->base = $this->getFilesystem()->get($parent_base); |
|
| 26 | ||
| 27 | parent::addParentContent($parent_function); |
|
| 28 | } |
|
| 29 | ||
| 30 | protected function addSteps(array $steps) |
|
| 31 | { |
|
| 32 | $path = __DIR__ . '/../../stubs/step.txt'; |
|
| 33 | $this->step_template = $this->getFilesystem()->get($path); |
|
| 34 | ||
| 35 | parent::addSteps($steps); |
|
| 36 | } |
|
| 37 | ||
| 38 | protected function getAndSetHeaderArea() |
|
| 39 | { |
|
| 40 | $path = __DIR__ . '/../../stubs/header.txt'; |
|
| 41 | $this->content = $this->getFilesystem()->get($path); |
|
| 42 | ||
| 43 | parent::getAndSetHeaderArea(); |
|
| 44 | } |
|
| 45 | ||
| 46 | protected function getAndSetFooterArea() |
|
| 47 | { |
|
| 48 | $path = __DIR__ . '/../../stubs/footer.txt'; |
|
| 49 | $content = $this->getFilesystem()->get($path); |
|
| 50 | ||
| 51 | $this->dusk_class_and_methods_string = $this->dusk_class_and_methods_string . $content; |
|
| 52 | } |
|
| 53 | } |
|
| 54 | ||