Skip to content

Commit

Permalink
Adds test case for generating targets based on a provided and existin…
Browse files Browse the repository at this point in the history
…g workflow namespace
  • Loading branch information
craigpaul committed Nov 26, 2023
1 parent 0dc81cb commit c79d375
Showing 1 changed file with 31 additions and 0 deletions.
31 changes: 31 additions & 0 deletions tests/CanGenerateTargetsFromWorkflowNamespaceTest.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
<?php

namespace CraigPaul\Blitz\Tests;

use Mockery\MockInterface;

class CanGenerateTargetsFromWorkflowNamespaceTest extends TestCase
{
public function testCanGenerateTargetsFromAnExistingWorkflowNamespace()
{
$namespace = 'Tests\\Blitz\\ExampleTest';

$response = [1, 2, 3];

$this->mock($namespace, function (MockInterface $mock) use ($response) {
return $mock->makePartial()
->shouldReceive('setUp')
->andReturnSelf()
->getMock()
->shouldReceive('getTargets')
->andReturn($response);
});

$this->withoutExceptionHandling()
->postJson(route('blitz.targets'), [
'namespace' => $namespace,
])
->assertOk()
->assertJson($response);
}
}

0 comments on commit c79d375

Please sign in to comment.