-
Notifications
You must be signed in to change notification settings - Fork 11
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #20 from spryker-sdk/feature/te-1877/master/add-mi…
…ssing-console-test-helper-and-spryk TE-1877 Added CommunicationTest suite spryks, added ConsoleTest spryk
- Loading branch information
Showing
90 changed files
with
546 additions
and
190 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 |
---|---|---|
|
@@ -26,3 +26,5 @@ arguments: | |
preSpryks: | ||
- AddModule | ||
|
||
postSpryks: | ||
- AddZedCommunicationConsoleTest |
29 changes: 29 additions & 0 deletions
29
config/spryk/spryks/Spryker/Zed/Communication/AddZedCommunicationConsoleTest.yml
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,29 @@ | ||
spryk: template | ||
description: "Adds a new ConsoleTest to the Zed application." | ||
mode: both | ||
|
||
arguments: | ||
module: | ||
inherit: true | ||
|
||
organization: | ||
inherit: true | ||
default: Spryker | ||
|
||
className: | ||
inherit: true | ||
|
||
template: | ||
value: Zed/Communication/ZedCommunicationConsoleTest.php.twig | ||
|
||
targetFilename: | ||
value: "{{ className }}ConsoleTest.php" | ||
|
||
targetPath: | ||
value: "{{ module }}/tests/{{ organization }}Test/Zed/{{ module }}/Communication/Console/" | ||
|
||
preSpryks: | ||
- AddModule | ||
|
||
postSpryks: | ||
- AddZedCommunicationTestSuite |
21 changes: 21 additions & 0 deletions
21
config/spryk/spryks/Spryker/Zed/Communication/AddZedCommunicationTestSuite.yml
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,21 @@ | ||
spryk: structure | ||
description: "Adds a new *module* Communication test suite directory." | ||
mode: both | ||
|
||
arguments: | ||
module: | ||
inherit: true | ||
|
||
organization: | ||
inherit: true | ||
default: Spryker | ||
|
||
targetPath: | ||
value: "{{ module }}/" | ||
|
||
directories: | ||
value: | ||
- "tests/{{ organization }}Test/Zed/{{ module }}/Communication/" | ||
|
||
postSpryks: | ||
- AddZedCommunicationTestSuiteConfiguration |
26 changes: 26 additions & 0 deletions
26
config/spryk/spryks/Spryker/Zed/Communication/AddZedCommunicationTestSuiteConfiguration.yml
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,26 @@ | ||
spryk: update-yml | ||
description: "Updates the *module* test configuration and adds the suite configuration for Communication tests." | ||
mode: both | ||
|
||
arguments: | ||
module: | ||
inherit: true | ||
|
||
organization: | ||
inherit: true | ||
default: Spryker | ||
|
||
template: | ||
value: Zed/Communication/ZedCommunicationTestSuiteCodeceptionConfiguration.yml.twig | ||
|
||
afterElement: | ||
value: coverage | ||
|
||
addToElement: | ||
value: suites | ||
|
||
targetPath: | ||
value: "{{ module }}/tests/{{ organization }}Test/Zed/{{ module }}/codeception.yml" | ||
|
||
preSpryks: | ||
- AddZedTestCodeceptionConfiguration |
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
46 changes: 46 additions & 0 deletions
46
config/spryk/templates/Zed/Communication/ZedCommunicationConsoleTest.php.twig
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,46 @@ | ||
<?php | ||
/** | ||
* Copyright © 2016-present Spryker Systems GmbH. All rights reserved. | ||
* Use of this software requires acceptance of the Evaluation License Agreement. See LICENSE file. | ||
*/ | ||
namespace {{ organization }}Test\Zed\{{ module }}\Communication\Console; | ||
use Codeception\Test\Unit; | ||
use {{ organization }}\Zed\{{ module }}\Communication\Console\{{ className | ensureConsoleSuffix }}; | ||
/** | ||
* Auto-generated group annotations | ||
* @group {{ organization }}Test | ||
* @group Zed | ||
* @group {{ module }} | ||
* @group Communication | ||
* @group Console | ||
* @group {{ className | ensureConsoleSuffix }}Test | ||
* Add your own group annotations below this line | ||
*/ | ||
class {{ className | ensureConsoleSuffix }}Test extends Unit | ||
{ | ||
/** | ||
* @var \{{ organization }}Test\Zed\{{ module }}\{{ module }}CommunicationTester | ||
*/ | ||
protected $tester; | ||
/** | ||
* @return void | ||
*/ | ||
public function testExecutes_add_test_info(): void | ||
{ | ||
$command = new {{ className | ensureConsoleSuffix }}(); | ||
$commandTester = $this->tester->getConsoleTester($command); | ||
$arguments = [ | ||
'command' => $command->getName(), | ||
]; | ||
$commandTester->execute($arguments); | ||
$this->assertSame({{ className | ensureConsoleSuffix }}::CODE_SUCCESS, $commandTester->getStatusCode()); | ||
} | ||
} |
10 changes: 10 additions & 0 deletions
10
...yk/templates/Zed/Communication/ZedCommunicationTestSuiteCodeceptionConfiguration.yml.twig
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,10 @@ | ||
Communication: | ||
path: Communication | ||
class_name: {{ module }}CommunicationTester | ||
modules: | ||
enabled: | ||
- Asserts | ||
- \SprykerTest\Shared\Testify\Helper\Environment | ||
- \SprykerTest\Shared\Testify\Helper\ConfigHelper | ||
- \SprykerTest\Shared\Testify\Helper\LocatorHelper | ||
- \SprykerTest\Shared\Testify\Helper\DependencyHelper |
35 changes: 35 additions & 0 deletions
35
src/SprykerSdk/Spryk/Model/Spryk/Filter/EnsureConsoleSuffixFilter.php
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,35 @@ | ||
<?php | ||
|
||
/** | ||
* Copyright © 2016-present Spryker Systems GmbH. All rights reserved. | ||
* Use of this software requires acceptance of the Evaluation License Agreement. See LICENSE file. | ||
*/ | ||
|
||
namespace SprykerSdk\Spryk\Model\Spryk\Filter; | ||
|
||
class EnsureConsoleSuffixFilter implements FilterInterface | ||
{ | ||
public const CONSOLE_SUFFIX = 'Console'; | ||
|
||
/** | ||
* @return string | ||
*/ | ||
public function getName(): string | ||
{ | ||
return 'ensureConsoleSuffix'; | ||
} | ||
|
||
/** | ||
* @param string $value | ||
* | ||
* @return string | ||
*/ | ||
public function filter(string $value): string | ||
{ | ||
if (mb_substr($value, - mb_strlen(static::CONSOLE_SUFFIX)) !== static::CONSOLE_SUFFIX) { | ||
$value = $value . static::CONSOLE_SUFFIX; | ||
} | ||
|
||
return ucfirst($value); | ||
} | ||
} |
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
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
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
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
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
Oops, something went wrong.