1. Go to this page and download the library: Download spryker/console library. Choose the download type require.
2. Extract the ZIP file and open the index.php.
3. Add this code to the index.php.
<?php
require_once('vendor/autoload.php');
/* Start to develop here. Best regards https://php-download.com/ */
spryker / console example snippets
use Codeception\Test\Unit;
use Symfony\Component\Console\Tester\CommandTester;
use Spryker\Zed\YourModule\Communication\Plugin\Console\YourConsoleCommand;
class YourConsoleCommandTest extends Unit
{
protected YourModuleTester $tester;
public function testExecutesSuccessfully(): void
{
// Arrange
$command = new YourConsoleCommand();
$commandTester = $this->tester->getConsoleTester($command);
// Act
$commandTester->execute([]);
// Assert
$this->assertSame(YourConsoleCommand::CODE_SUCCESS, $commandTester->getStatusCode());
$this->assertStringContainsString('Expected output', $commandTester->getDisplay());
}
}