1 | <?php |
||
25 | abstract class AbstractGeneratorTest extends \PHPUnit_Framework_TestCase |
||
26 | { |
||
27 | /** |
||
28 | * @var \Faker\Generator |
||
29 | */ |
||
30 | protected $faker; |
||
31 | |||
32 | /** |
||
33 | * @var Settings |
||
34 | */ |
||
35 | protected $settings; |
||
36 | |||
37 | /** |
||
38 | * @var ShopInfo |
||
39 | */ |
||
40 | protected $shopInfo; |
||
41 | |||
42 | /** |
||
43 | * @var array |
||
44 | */ |
||
45 | protected $currencies; |
||
46 | |||
47 | /** |
||
48 | * @var array |
||
49 | */ |
||
50 | protected $categories; |
||
51 | |||
52 | /** |
||
53 | * @var array |
||
54 | */ |
||
55 | protected $deliveries; |
||
56 | |||
57 | /** |
||
58 | * @var string |
||
59 | */ |
||
60 | protected $offerType; |
||
61 | |||
62 | /** |
||
63 | * Test setup |
||
64 | */ |
||
65 | public function setUp() |
||
66 | { |
||
67 | $this->faker = Faker::create(); |
||
68 | |||
69 | $this->settings = $this->createSettings(); |
||
70 | $this->shopInfo = $this->createShopInfo(); |
||
71 | $this->currencies = $this->createCurrencies(); |
||
72 | $this->categories = $this->createCategories(); |
||
73 | $this->deliveries = $this->createDeliveries(); |
||
74 | } |
||
75 | |||
76 | /** |
||
77 | * @return \Bukashk0zzz\YmlGenerator\Model\Offer\AbstractOffer |
||
78 | */ |
||
79 | abstract protected function createOffer(); |
||
80 | |||
81 | /** |
||
82 | * Produces an XML file and writes to $this->settings->getOutputFile() |
||
83 | */ |
||
84 | protected function generateFile() |
||
94 | |||
95 | /** |
||
96 | * Test generation |
||
97 | */ |
||
98 | protected function runGeneratorTest() |
||
103 | |||
104 | /** |
||
105 | * @return array |
||
106 | */ |
||
107 | protected function createOffers() |
||
137 | |||
138 | /** |
||
139 | * Validate yml file using dtd |
||
140 | */ |
||
141 | private function validateFileWithDtd() |
||
164 | |||
165 | /** |
||
166 | * @return Settings |
||
167 | */ |
||
168 | private function createSettings() |
||
176 | |||
177 | /** |
||
178 | * @return ShopInfo |
||
179 | */ |
||
180 | private function createShopInfo() |
||
192 | |||
193 | /** |
||
194 | * @return array |
||
195 | */ |
||
196 | private function createCurrencies() |
||
206 | |||
207 | /** |
||
208 | * @return array |
||
209 | */ |
||
210 | private function createCategories() |
||
226 | |||
227 | /** |
||
228 | * @return array |
||
229 | */ |
||
230 | private function createDeliveries() |
||
244 | } |
||
245 |