@@ 34-84 (lines=51) @@ | ||
31 | * |
|
32 | * @author MageTest team (https://github.com/MageTest/MageSpec/contributors) |
|
33 | */ |
|
34 | class BlockResource implements ResourceInterface |
|
35 | { |
|
36 | private $parts; |
|
37 | private $locator; |
|
38 | ||
39 | public function __construct(array $parts, BlockLocator $locator) |
|
40 | { |
|
41 | $this->parts = $parts; |
|
42 | $this->locator = $locator; |
|
43 | } |
|
44 | ||
45 | public function getName() |
|
46 | { |
|
47 | return implode('_', $this->parts); |
|
48 | } |
|
49 | ||
50 | public function getSpecName() |
|
51 | { |
|
52 | return $this->getName() . 'Spec'; |
|
53 | } |
|
54 | ||
55 | public function getSrcFilename() |
|
56 | { |
|
57 | return $this->locator->getFullSrcPath() . implode(DIRECTORY_SEPARATOR, $this->parts) . '.php'; |
|
58 | } |
|
59 | ||
60 | public function getSrcNamespace() |
|
61 | { |
|
62 | return ''; |
|
63 | } |
|
64 | ||
65 | public function getSrcClassname() |
|
66 | { |
|
67 | return implode('_', $this->parts); |
|
68 | } |
|
69 | ||
70 | public function getSpecFilename() |
|
71 | { |
|
72 | return $this->locator->getFullSpecPath() . implode(DIRECTORY_SEPARATOR, $this->parts) . 'Spec.php'; |
|
73 | } |
|
74 | ||
75 | public function getSpecNamespace() |
|
76 | { |
|
77 | return rtrim($this->locator->getSpecNamespace(), '/\\'); |
|
78 | } |
|
79 | ||
80 | public function getSpecClassname() |
|
81 | { |
|
82 | return $this->locator->getSpecNamespace() . implode('_', $this->parts).'Spec'; |
|
83 | } |
|
84 | } |
@@ 34-84 (lines=51) @@ | ||
31 | * |
|
32 | * @author MageTest team (https://github.com/MageTest/MageSpec/contributors) |
|
33 | */ |
|
34 | class HelperResource implements ResourceInterface |
|
35 | { |
|
36 | private $parts; |
|
37 | private $locator; |
|
38 | ||
39 | public function __construct(array $parts, HelperLocator $locator) |
|
40 | { |
|
41 | $this->parts = $parts; |
|
42 | $this->locator = $locator; |
|
43 | } |
|
44 | ||
45 | public function getName() |
|
46 | { |
|
47 | return implode('_', $this->parts); |
|
48 | } |
|
49 | ||
50 | public function getSpecName() |
|
51 | { |
|
52 | return $this->getName() . 'Spec'; |
|
53 | } |
|
54 | ||
55 | public function getSrcFilename() |
|
56 | { |
|
57 | return $this->locator->getFullSrcPath() . implode(DIRECTORY_SEPARATOR, $this->parts) . '.php'; |
|
58 | } |
|
59 | ||
60 | public function getSrcNamespace() |
|
61 | { |
|
62 | return ''; |
|
63 | } |
|
64 | ||
65 | public function getSrcClassname() |
|
66 | { |
|
67 | return implode('_', $this->parts); |
|
68 | } |
|
69 | ||
70 | public function getSpecFilename() |
|
71 | { |
|
72 | return $this->locator->getFullSpecPath() . implode(DIRECTORY_SEPARATOR, $this->parts) . 'Spec.php'; |
|
73 | } |
|
74 | ||
75 | public function getSpecNamespace() |
|
76 | { |
|
77 | return rtrim($this->locator->getSpecNamespace(), '/\\'); |
|
78 | } |
|
79 | ||
80 | public function getSpecClassname() |
|
81 | { |
|
82 | return $this->locator->getSpecNamespace() . implode('_', $this->parts).'Spec'; |
|
83 | } |
|
84 | } |
@@ 34-84 (lines=51) @@ | ||
31 | * |
|
32 | * @author MageTest team (https://github.com/MageTest/MageSpec/contributors) |
|
33 | */ |
|
34 | class ModelResource implements ResourceInterface |
|
35 | { |
|
36 | private $parts; |
|
37 | private $locator; |
|
38 | ||
39 | public function __construct(array $parts, ModelLocator $locator) |
|
40 | { |
|
41 | $this->parts = $parts; |
|
42 | $this->locator = $locator; |
|
43 | } |
|
44 | ||
45 | public function getName() |
|
46 | { |
|
47 | return implode('_', $this->parts); |
|
48 | } |
|
49 | ||
50 | public function getSpecName() |
|
51 | { |
|
52 | return $this->getName() . 'Spec'; |
|
53 | } |
|
54 | ||
55 | public function getSrcFilename() |
|
56 | { |
|
57 | return $this->locator->getFullSrcPath() . implode(DIRECTORY_SEPARATOR, $this->parts) . '.php'; |
|
58 | } |
|
59 | ||
60 | public function getSrcNamespace() |
|
61 | { |
|
62 | return ''; |
|
63 | } |
|
64 | ||
65 | public function getSrcClassname() |
|
66 | { |
|
67 | return implode('_', $this->parts); |
|
68 | } |
|
69 | ||
70 | public function getSpecFilename() |
|
71 | { |
|
72 | return $this->locator->getFullSpecPath() . implode(DIRECTORY_SEPARATOR, $this->parts) . 'Spec.php'; |
|
73 | } |
|
74 | ||
75 | public function getSpecNamespace() |
|
76 | { |
|
77 | return rtrim($this->locator->getSpecNamespace(), '/\\'); |
|
78 | } |
|
79 | ||
80 | public function getSpecClassname() |
|
81 | { |
|
82 | return $this->locator->getSpecNamespace() . implode('_', $this->parts).'Spec'; |
|
83 | } |
|
84 | } |