Esempio n. 1
0
 function it_processes_etl_sequentially(ExtractorInterface $extractor, TransformerInterface $transformer, LoaderInterface $loader)
 {
     $extractor->extract()->shouldBeCalled()->willReturn(['a1', 'b1', 'c1'], null);
     $transformer->transform(['a1', 'b1', 'c1'])->shouldBeCalled()->willReturn(['c1', 'b1', 'a1']);
     $loader->load(['c1', 'b1', 'a1'])->shouldBeCalled();
     $loader->flush()->shouldBeCalled();
     $this->process();
 }
 function it_applies_transformer_on_given_path(TransformerInterface $transformer)
 {
     $transformer->transform('bar')->shouldBeCalled()->willReturn('Bar');
     $this->transform(['foo' => 'foo', 'bar' => 'bar'])->shouldReturn(['foo' => 'foo', 'bar' => 'Bar']);
 }
 function it_transforms_using_all_registered_transformers(TransformerInterface $reverseTransformer, TransformerInterface $capitalizeTransformer)
 {
     $reverseTransformer->transform(['foo', 'bar'])->shouldBeCalled()->willReturn(['bar', 'foo']);
     $capitalizeTransformer->transform(['bar', 'foo'])->shouldBeCalled()->willReturn(['Bar', 'Foo']);
     $this->transform(['foo', 'bar'])->shouldReturn(['Bar', 'Foo']);
 }