Skip to content

Commit

Permalink
remove container
Browse files Browse the repository at this point in the history
  • Loading branch information
rodber committed Oct 31, 2023
1 parent 2f69a23 commit 7c91fbf
Showing 1 changed file with 7 additions and 13 deletions.
20 changes: 7 additions & 13 deletions tests/RunnerTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,6 @@

namespace Chevere\Tests;

use Chevere\Container\Container;
use Chevere\Tests\src\TestActionNoParams;
use Chevere\Tests\src\TestActionNoParamsBoolResponses;
use Chevere\Tests\src\TestActionNoParamsIntResponse;
Expand All @@ -36,7 +35,6 @@ final class RunnerTest extends TestCase
{
public function testRunnerForArguments(): void
{
$container = new Container();
$jobsRunArguments = [
'job1' => [
'foo' => 'viva Chile!',
Expand Down Expand Up @@ -68,7 +66,7 @@ public function testRunnerForArguments(): void
];
$workflow = workflow(...$jobs);
$run = new Run($workflow);
$runner = new Runner($run, $container);
$runner = new Runner($run);
foreach (array_keys($jobs) as $name) {
$runner = $runner->withRunJob($name);
}
Expand All @@ -79,7 +77,6 @@ public function testRunnerForArguments(): void

public function testRunnerForVariables(): void
{
$container = new Container();
$variables = [
'uno' => 'ha salido un nuevo estilo de baile',
'dos' => 'y yo, no lo sabia',
Expand Down Expand Up @@ -128,7 +125,7 @@ public function testRunnerForVariables(): void
];
$workflow = workflow(...$jobs);
$run = new Run($workflow, ...$variables);
$runner = new Runner($run, $container);
$runner = new Runner($run);
foreach (array_keys($jobs) as $name) {
$runner = $runner->withRunJob($name);
}
Expand All @@ -139,7 +136,6 @@ public function testRunnerForVariables(): void

public function testRunnerForReferences(): void
{
$container = new Container();
$references = [
'uno' => 'quisiera sacarte a caminar, en un largo tour',
'dos' => 'por Pudahuel y La bandera',
Expand Down Expand Up @@ -177,7 +173,7 @@ public function testRunnerForReferences(): void
];
$workflow = workflow(...$jobs);
$run = new Run($workflow);
$runner = new Runner($run, $container);
$runner = new Runner($run);
foreach (array_keys($jobs) as $name) {
$runner = $runner->withRunJob($name);
}
Expand All @@ -188,7 +184,6 @@ public function testRunnerForReferences(): void

public function testWithRunIfVariable(): void
{
$container = new Container();
$name = 'variable';
$job = async(new TestActionNoParams())
->withRunIf(variable($name));
Expand All @@ -197,7 +192,7 @@ public function testWithRunIfVariable(): void
$name => true,
];
$run = new Run($workflow, ...$arguments);
$runner = new Runner($run, $container);
$runner = new Runner($run);
$runner = $runner->withRunJob('job1');
$action = $job->action();
$this->assertSame(
Expand All @@ -208,7 +203,7 @@ public function testWithRunIfVariable(): void
$name => false,
];
$run = new Run($workflow, ...$arguments);
$runner = new Runner($run, $container);
$runner = new Runner($run);
$runner = $runner->withRunJob('job1');
$this->assertSame($workflow->jobs()->keys(), $runner->run()->skip()->toArray());
$run = run($workflow, ...$arguments);
Expand All @@ -219,7 +214,6 @@ public function testWithRunIfVariable(): void

public function testRunIfReference(): void
{
$container = new Container();
$job1 = async(new TestActionNoParamsBoolResponses());
$job2 = async(new TestActionNoParamsBoolResponses());
$job3 = async(new TestActionNoParamsIntResponse());
Expand All @@ -231,7 +225,7 @@ public function testRunIfReference(): void
job4: $job4->withDepends('job3')
);
$run = new Run($workflow);
$runner = new Runner($run, $container);
$runner = new Runner($run);
foreach ($workflow->jobs()->keys() as $name) {
$runner = $runner->withRunJob($name);
$runner->run()->getResponse($name)->array();
Expand All @@ -243,7 +237,7 @@ public function testRunIfReference(): void
job4: $job1->withDepends('job3')
);
$run = new Run($workflow);
$runner = new Runner($run, $container);
$runner = new Runner($run);
foreach ($workflow->jobs()->keys() as $name) {
$runner = $runner->withRunJob($name);
}
Expand Down

0 comments on commit 7c91fbf

Please sign in to comment.