-
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
To be sure that a new version of contentful client or any other variables that might interfeer in the execution of this command doesn't break it, we're adding an integration test that will hit the real contentful API. Signed-off-by: Airton Zanon <[email protected]>
- Loading branch information
1 parent
3861bce
commit 0fd8a30
Showing
3 changed files
with
34 additions
and
4 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,28 @@ | ||
<?php | ||
declare(strict_types=1); | ||
|
||
namespace AirtonZanon\SculpinContentfulBundle\Tests\Integration; | ||
|
||
use AirtonZanon\SculpinContentfulBundle\Command\SculpinContentfulCommand; | ||
use Contentful\Delivery\Client; | ||
use PHPUnit\Framework\TestCase; | ||
use Symfony\Component\Console\Tester\CommandTester; | ||
|
||
final class SculpinContentfulCommandTest extends TestCase | ||
{ | ||
public function testExecuteSuccessScenario(): void { | ||
$command = new SculpinContentfulCommand(); | ||
|
||
$contentfulSpaceId = getenv('contentful_space_id'); | ||
$contentfulToken = getenv('contentful_token'); | ||
|
||
$client = new Client($contentfulToken, $contentfulSpaceId); | ||
|
||
$command->setContentfulClient($client); | ||
$commandTester = new CommandTester($command); | ||
$commandTester->execute([]); | ||
|
||
$output = $commandTester->getDisplay(); | ||
self::assertStringContainsString("Created file", $output); | ||
} | ||
} |