mirror of
https://github.com/symfony/recipes-contrib.git
synced 2026-09-12 23:56:29 +03:00
Add codeception/codeception/2.3
This commit is contained in:
@@ -0,0 +1,13 @@
|
||||
namespace: App\Tests
|
||||
paths:
|
||||
tests: tests
|
||||
output: tests/_output
|
||||
data: tests/_data
|
||||
support: tests/_support
|
||||
envs: tests/_envs
|
||||
actor_suffix: Tester
|
||||
extensions:
|
||||
enabled:
|
||||
- Codeception\Extension\RunFailed
|
||||
params:
|
||||
- .env
|
||||
@@ -0,0 +1,14 @@
|
||||
{
|
||||
"copy-from-recipe": {
|
||||
"codeception.yaml": "codeception.yml",
|
||||
"tests/_data/": "tests/_data/",
|
||||
"tests/_output/": "tests/_output/",
|
||||
"tests/_support/": "tests/_support",
|
||||
"tests/acceptance/": "tests/acceptance/",
|
||||
"tests/functional/": "tests/functional/",
|
||||
"tests/unit/": "tests/unit/",
|
||||
"tests/acceptance.suite.yaml": "tests/acceptance.suite.yml",
|
||||
"tests/functional.suite.yaml": "tests/functional.suite.yml",
|
||||
"tests/unit.suite.yaml": "tests/unit.suite.yml"
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,15 @@
|
||||
<fg=white;bg=magenta> Bootstrapping Codeception </fg=white;bg=magenta>
|
||||
File codeception.yaml created <- global configuration
|
||||
tests/unit created <- unit tests
|
||||
tests/unit.suite.yaml written <- unit tests suite configuration
|
||||
tests/functional created <- functional tests
|
||||
tests/functional.suite.yaml written <- functional tests suite configuration
|
||||
tests/acceptance created <- acceptance tests
|
||||
tests/acceptance.suite.yaml written <- acceptance tests suite configuration
|
||||
<info>Codeception is installed for acceptance, functional, and unit testing</info>
|
||||
<options=bold>Next steps:</options=bold>
|
||||
1. Edit <options=bold>tests/acceptance.suite.yaml</options=bold> to set url of your application. Change PhpBrowser to WebDriver to enable browser testing
|
||||
2. Edit <options=bold>tests/functional.suite.yaml</options=bold> to enable a Doctrine module if needs.
|
||||
3. Create your first acceptance tests using <comment>vendor/bin/codecept g:cest acceptance First</comment>
|
||||
4. Write first test in <options=bold>tests/acceptance/FirstCest.php</options=bold>
|
||||
5. Run tests using: <comment>vendor/bin/codecept run</comment>
|
||||
@@ -0,0 +1,2 @@
|
||||
*
|
||||
!.gitignore
|
||||
@@ -0,0 +1,26 @@
|
||||
<?php
|
||||
namespace App\Tests;
|
||||
|
||||
/**
|
||||
* 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 \Codeception\Lib\Friend haveFriend($name, $actorClass = NULL)
|
||||
*
|
||||
* @SuppressWarnings(PHPMD)
|
||||
*/
|
||||
class AcceptanceTester extends \Codeception\Actor
|
||||
{
|
||||
use _generated\AcceptanceTesterActions;
|
||||
|
||||
/**
|
||||
* Define custom actions here
|
||||
*/
|
||||
}
|
||||
@@ -0,0 +1,26 @@
|
||||
<?php
|
||||
namespace App\Tests;
|
||||
|
||||
/**
|
||||
* 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 \Codeception\Lib\Friend haveFriend($name, $actorClass = NULL)
|
||||
*
|
||||
* @SuppressWarnings(PHPMD)
|
||||
*/
|
||||
class FunctionalTester extends \Codeception\Actor
|
||||
{
|
||||
use _generated\FunctionalTesterActions;
|
||||
|
||||
/**
|
||||
* Define custom actions here
|
||||
*/
|
||||
}
|
||||
@@ -0,0 +1,10 @@
|
||||
<?php
|
||||
namespace App\Tests\Helper;
|
||||
|
||||
// here you can define custom actions
|
||||
// all public methods declared in helper class will be available in $I
|
||||
|
||||
class Acceptance extends \Codeception\Module
|
||||
{
|
||||
|
||||
}
|
||||
@@ -0,0 +1,10 @@
|
||||
<?php
|
||||
namespace App\Tests\Helper;
|
||||
|
||||
// here you can define custom actions
|
||||
// all public methods declared in helper class will be available in $I
|
||||
|
||||
class Functional extends \Codeception\Module
|
||||
{
|
||||
|
||||
}
|
||||
@@ -0,0 +1,10 @@
|
||||
<?php
|
||||
namespace App\Tests\Helper;
|
||||
|
||||
// here you can define custom actions
|
||||
// all public methods declared in helper class will be available in $I
|
||||
|
||||
class Unit extends \Codeception\Module
|
||||
{
|
||||
|
||||
}
|
||||
@@ -0,0 +1,26 @@
|
||||
<?php
|
||||
namespace App\Tests;
|
||||
|
||||
/**
|
||||
* 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 \Codeception\Lib\Friend haveFriend($name, $actorClass = NULL)
|
||||
*
|
||||
* @SuppressWarnings(PHPMD)
|
||||
*/
|
||||
class UnitTester extends \Codeception\Actor
|
||||
{
|
||||
use _generated\UnitTesterActions;
|
||||
|
||||
/**
|
||||
* Define custom actions here
|
||||
*/
|
||||
}
|
||||
@@ -0,0 +1,2 @@
|
||||
*
|
||||
!.gitignore
|
||||
@@ -0,0 +1,12 @@
|
||||
# Codeception Test Suite Configuration
|
||||
#
|
||||
# Suite for acceptance tests.
|
||||
# Perform tests in browser using the WebDriver or PhpBrowser.
|
||||
# If you need both WebDriver and PHPBrowser tests - create a separate suite.
|
||||
|
||||
actor: AcceptanceTester
|
||||
modules:
|
||||
enabled:
|
||||
- PhpBrowser:
|
||||
url: http://localhost:8000
|
||||
- \App\Tests\Helper\Acceptance
|
||||
@@ -0,0 +1,17 @@
|
||||
# Codeception Test Suite Configuration
|
||||
#
|
||||
# Suite for functional tests
|
||||
# Emulate web requests and make application process them
|
||||
# Include one of framework modules (Symfony2, Yii2, Laravel5) to use it
|
||||
# Remove this suite if you don't use frameworks
|
||||
|
||||
actor: FunctionalTester
|
||||
modules:
|
||||
enabled:
|
||||
- Symfony:
|
||||
app_path: 'src'
|
||||
environment: 'test'
|
||||
# - Doctrine2:
|
||||
# depends: Symfony
|
||||
# cleanup: true
|
||||
- \App\Tests\Helper\Functional
|
||||
@@ -0,0 +1,9 @@
|
||||
# Codeception Test Suite Configuration
|
||||
#
|
||||
# Suite for unit or integration tests.
|
||||
|
||||
actor: UnitTester
|
||||
modules:
|
||||
enabled:
|
||||
- Asserts
|
||||
- \App\Tests\Helper\Unit
|
||||
Reference in New Issue
Block a user