-
-
Notifications
You must be signed in to change notification settings - Fork 30
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
27 changed files
with
386 additions
and
7 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,40 @@ | ||
actor: Tester | ||
paths: | ||
tests: tests | ||
log: tests/_output | ||
data: tests/_data | ||
support: tests/_support | ||
envs: tests/_envs | ||
settings: | ||
bootstrap: _bootstrap.php | ||
coverage: | ||
enabled: true | ||
include: | ||
- src/* | ||
exclude: | ||
- src/etc/* | ||
- src/migrations/* | ||
- src/templates/* | ||
- src/translations/* | ||
- src/web/assets/* | ||
- docs/* | ||
- templates/* | ||
- tests/* | ||
- vendor/* | ||
params: | ||
- tests/.env | ||
modules: | ||
config: | ||
\craft\test\Craft: | ||
configFile: 'tests/_craft/config/test.php' | ||
entryUrl: 'https://test.craftcms.test/index.php' | ||
projectConfig: {} | ||
migrations: [] | ||
plugins: | ||
<%= pluginKebabHandle %>: | ||
class: '\<%= pluginVendorName %>\<%= pluginDirName %>\<%= pluginHandle %>' | ||
handle: <%= pluginKebabHandle %> | ||
cleanup: true | ||
transaction: true | ||
dbSetup: {clean: true, setupCraft: true} | ||
fullMock: false |
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 @@ | ||
*.env |
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,17 @@ | ||
<?php | ||
|
||
use craft\test\TestSetup; | ||
|
||
ini_set('date.timezone', 'UTC'); | ||
|
||
// Use the current installation of Craft | ||
define('CRAFT_STORAGE_PATH', __DIR__ . '/_craft/storage'); | ||
define('CRAFT_TEMPLATES_PATH', __DIR__ . '/_craft/templates'); | ||
define('CRAFT_CONFIG_PATH', __DIR__ . '/_craft/config'); | ||
define('CRAFT_MIGRATIONS_PATH', __DIR__ . '/_craft/migrations'); | ||
define('CRAFT_TRANSLATIONS_PATH', __DIR__ . '/_craft/translations'); | ||
define('CRAFT_VENDOR_PATH', dirname(__DIR__) . '/vendor'); | ||
|
||
$devMode = true; | ||
|
||
TestSetup::configureCraft(); |
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,4 @@ | ||
storage/* | ||
|
||
!storage/example-file.txt | ||
|
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,12 @@ | ||
<?php | ||
|
||
return [ | ||
'password' => getenv('DB_PASSWORD'), | ||
'user' => getenv('DB_USER'), | ||
'database' => getenv('DB_DATABASE'), | ||
'tablePrefix' => getenv('DB_TABLE_PREFIX'), | ||
'driver' => getenv('DB_DRIVER'), | ||
'port' => getenv('DB_PORT'), | ||
'schema' => getenv('DB_SCHEMA'), | ||
'server' => getenv('DB_SERVER'), | ||
]; |
5 changes: 5 additions & 0 deletions
5
app/templates/api_version_3_0/tests/_craft/config/general.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,5 @@ | ||
<?php | ||
|
||
return [ | ||
'devMode' => true, | ||
]; |
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,5 @@ | ||
<?php | ||
|
||
return [ | ||
|
||
]; |
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,5 @@ | ||
<?php | ||
|
||
use craft\test\TestSetup; | ||
|
||
return TestSetup::createTestCraftObjectConfig(); |
Empty file.
1 change: 1 addition & 0 deletions
1
app/templates/api_version_3_0/tests/_craft/templates/example.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 @@ | ||
Im a twig template and here's a random number {{ random() }} |
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 @@ | ||
_generated/* |
35 changes: 35 additions & 0 deletions
35
app/templates/api_version_3_0/tests/_support/FunctionalTester.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 | ||
/** | ||
* <%- pluginName %> plugin for Craft CMS 3.x | ||
* | ||
* <%- pluginDescription %> | ||
* | ||
* @link <%= pluginAuthorUrl %> | ||
* @copyright <%- copyrightNotice %> | ||
*/ | ||
|
||
use Codeception\Actor; | ||
use Codeception\Lib\Friend; | ||
|
||
/** | ||
* Inherited Methods | ||
* | ||
* @method void wantToTest($text) | ||
* @method void wantTo($text) | ||
* @method void execute($callable) | ||
* @method void expectTo($prediction) | ||
* @method void expect($prediction) | ||
* @method void amGoingTo($argumentation) | ||
* @method void am($role) | ||
* @method void lookForwardTo($achieveValue) | ||
* @method void comment($description) | ||
* @method Friend haveFriend($name, $actorClass = null) | ||
* | ||
* @SuppressWarnings(PHPMD) | ||
* | ||
*/ | ||
class FunctionalTester extends Actor | ||
{ | ||
use _generated\FunctionalTesterActions; | ||
|
||
} |
24 changes: 24 additions & 0 deletions
24
app/templates/api_version_3_0/tests/_support/Helper/Functional.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,24 @@ | ||
<?php | ||
/** | ||
* <%- pluginName %> plugin for Craft CMS 3.x | ||
* | ||
* <%- pluginDescription %> | ||
* | ||
* @link <%= pluginAuthorUrl %> | ||
* @copyright <%- copyrightNotice %> | ||
*/ | ||
|
||
namespace Helper; | ||
|
||
use Codeception\Module; | ||
|
||
/** | ||
* Class Functional | ||
* | ||
* Here you can define custom actions. | ||
* All public methods declared in helper class will be available in $I | ||
*/ | ||
class Functional extends Module | ||
{ | ||
|
||
} |
25 changes: 25 additions & 0 deletions
25
app/templates/api_version_3_0/tests/_support/Helper/Unit.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,25 @@ | ||
<?php | ||
/** | ||
* <%- pluginName %> plugin for Craft CMS 3.x | ||
* | ||
* <%- pluginDescription %> | ||
* | ||
* @link <%= pluginAuthorUrl %> | ||
* @copyright <%- copyrightNotice %> | ||
*/ | ||
|
||
namespace Helper; | ||
|
||
use Codeception\Module; | ||
|
||
/** | ||
* Class Unit | ||
* | ||
* Here you can define custom actions. | ||
* All public methods declared in helper class will be available in $I | ||
* | ||
*/ | ||
class Unit extends Module | ||
{ | ||
|
||
} |
35 changes: 35 additions & 0 deletions
35
app/templates/api_version_3_0/tests/_support/UnitTester.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 | ||
/** | ||
* <%- pluginName %> plugin for Craft CMS 3.x | ||
* | ||
* <%- pluginDescription %> | ||
* | ||
* @link <%= pluginAuthorUrl %> | ||
* @copyright <%- copyrightNotice %> | ||
*/ | ||
|
||
use Codeception\Actor; | ||
use Codeception\Lib\Friend; | ||
|
||
/** | ||
* Inherited Methods | ||
* | ||
* @method void wantToTest($text) | ||
* @method void wantTo($text) | ||
* @method void execute($callable) | ||
* @method void expectTo($prediction) | ||
* @method void expect($prediction) | ||
* @method void amGoingTo($argumentation) | ||
* @method void am($role) | ||
* @method void lookForwardTo($achieveValue) | ||
* @method void comment($description) | ||
* @method Friend haveFriend($name, $actorClass = null) | ||
* | ||
* @SuppressWarnings(PHPMD) | ||
* | ||
*/ | ||
class UnitTester extends Actor | ||
{ | ||
use _generated\UnitTesterActions; | ||
|
||
} |
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,11 @@ | ||
# Set in accordance to your environment | ||
|
||
DB_DRIVER="mysql" | ||
DB_SERVER="localhost" | ||
DB_USER="root" | ||
DB_PASSWORD="" | ||
DB_DATABASE="craft-test" | ||
DB_SCHEMA="" | ||
DB_TABLE_PREFIX="craft" | ||
DB_PORT="3306" | ||
SECURITY_KEY="abcde12345" |
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,5 @@ | ||
actor: FunctionalTester | ||
modules: | ||
enabled: | ||
- \craft\test\Craft | ||
- \Helper\Functional |
Oops, something went wrong.