1 | <?php |
||
10 | class YamlPipelineRepositorySpec extends ObjectBehavior |
||
11 | { |
||
12 | |||
13 | /** |
||
14 | * @author Andrea Marco Sartori |
||
15 | * @var array $pipeline Example of pipeline. |
||
16 | */ |
||
17 | private $pipeline = array('RegisterUser' => ['Notifier', 'Logger']); |
||
18 | |||
19 | function let(YamlParserInterface $parser, Filesystem $files) |
||
20 | { |
||
21 | $this->beConstructedWith($parser, $files, 'path/to/workflows'); |
||
22 | |||
23 | $parser->parse('path/to/workflows/workflows.yml')->shouldBeCalled()->willReturn($this->pipeline); |
||
24 | } |
||
25 | |||
26 | function it_is_initializable() |
||
27 | { |
||
28 | $this->shouldHaveType('Cerbero\Workflow\Repositories\YamlPipelineRepository'); |
||
29 | $this->shouldHaveType('Cerbero\Workflow\Repositories\PipelineRepositoryInterface'); |
||
30 | } |
||
31 | |||
32 | /** |
||
33 | * @testdox It returns false when a pipeline does not exist. |
||
34 | * |
||
35 | * @author Andrea Marco Sartori |
||
36 | * @return void |
||
37 | */ |
||
38 | public function it_returns_false_when_a_pipeline_does_not_exist() |
||
42 | |||
43 | /** |
||
44 | * @testdox It returns true when a pipeline exists. |
||
45 | * |
||
46 | * @author Andrea Marco Sartori |
||
47 | * @return void |
||
48 | */ |
||
49 | public function it_returns_true_when_a_pipeline_exists() |
||
53 | |||
54 | /** |
||
55 | * @testdox It returns the pipeline of a fiven workflow. |
||
56 | * |
||
57 | * @author Andrea Marco Sartori |
||
58 | * @return void |
||
59 | */ |
||
60 | public function it_returns_the_pipeline_of_a_fiven_workflow() |
||
66 | |||
67 | /** |
||
68 | * @testdox It retrieves the source of the pipelines. |
||
69 | * |
||
70 | * @author Andrea Marco Sartori |
||
71 | * @return void |
||
72 | */ |
||
73 | public function it_retrieves_the_source_of_the_pipelines() |
||
77 | |||
78 | /** |
||
79 | * @testdox It creates the YAML file. |
||
80 | * |
||
81 | * @author Andrea Marco Sartori |
||
82 | * @return void |
||
83 | */ |
||
84 | public function it_creates_the_YAML_file($files) |
||
92 | |||
93 | /** |
||
94 | * @testdox It stores the given pipeline and its pipes. |
||
95 | * |
||
96 | * @author Andrea Marco Sartori |
||
97 | * @return void |
||
98 | */ |
||
99 | public function it_stores_the_given_pipeline_and_its_pipes($parser, $files) |
||
107 | |||
108 | /** |
||
109 | * @testdox It updates an existing pipeline by attaching and detaching pipes. |
||
110 | * |
||
111 | * @author Andrea Marco Sartori |
||
112 | * @return void |
||
113 | */ |
||
114 | public function it_updates_an_existing_pipeline_by_attaching_and_detaching_pipes($parser, $files) |
||
124 | |||
125 | /** |
||
126 | * @testdox It does not attach if no attachments are specified. |
||
127 | * |
||
128 | * @author Andrea Marco Sartori |
||
129 | * @return void |
||
130 | */ |
||
131 | public function it_does_not_attach_if_no_attachments_are_specified($parser, $files) |
||
141 | |||
142 | /** |
||
143 | * @testdox It does not detach if no detachments are specified. |
||
144 | * |
||
145 | * @author Andrea Marco Sartori |
||
146 | * @return void |
||
147 | */ |
||
148 | public function it_does_not_detach_if_no_detachments_are_specified($parser, $files) |
||
158 | |||
159 | /** |
||
160 | * @testdox It destroys a pipeline. |
||
161 | * |
||
162 | * @author Andrea Marco Sartori |
||
163 | * @return void |
||
164 | */ |
||
165 | public function it_destroys_a_pipeline($parser, $files) |
||
173 | } |
||
174 |