Skip to content
This repository has been archived by the owner on Feb 12, 2023. It is now read-only.

Commit

Permalink
feat: Pipeline test updated using PipelineFactory
Browse files Browse the repository at this point in the history
  • Loading branch information
mkorkmaz committed Jul 12, 2021
1 parent 8ef50ae commit c4fcf2f
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions tests/unit/Pipeline/PipelineTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -10,8 +10,9 @@
use Selami\Resources\Pipelines\Multiplier;
use Selami\Stdlib\Pipeline\InvalidStageException;
use Selami\Stdlib\Pipeline\Pipeline;
use Selami\Stdlib\Pipeline\PipelineInterface;
use Selami\Stdlib\Pipeline\StageDoesNotExistException;

use Selami\Stdlib\Pipeline\PipelineFactory;
class PipelineTest extends Unit
{
protected $tester;
Expand All @@ -21,6 +22,7 @@ protected function _before(): void
{
$this->serviceManager = new ServiceManager([
'factories' => [
PipelineInterface::class => PipelineFactory::class,
Adder::class => InvokableFactory::class,
],
]);
Expand All @@ -35,7 +37,7 @@ protected function _after(): void
*/
public function shouldSuccessfullyCalculateUsingPipes() : void
{
$pipeline = Pipeline::withContainer($this->serviceManager)
$pipeline = $this->serviceManager->get(PipelineInterface::class)
->pipe(Adder::class)
->pipe(new Multiplier(2));

Expand Down

0 comments on commit c4fcf2f

Please sign in to comment.