Skip to content

Commit 1cc79e5

Browse files
committed
Bootstrap Codeception & configure functional suite for Symfonys
1 parent 2573f07 commit 1cc79e5

File tree

16 files changed

+160
-0
lines changed

16 files changed

+160
-0
lines changed

codeception.yml

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
namespace: App\Tests
2+
paths:
3+
tests: tests
4+
output: tests/_output
5+
data: tests/_data
6+
support: tests/_support
7+
envs: tests/_envs
8+
actor_suffix: Tester
9+
extensions:
10+
enabled:
11+
- Codeception\Extension\RunFailed
12+
params:
13+
- .env

tests/_data/.gitkeep

Whitespace-only changes.

tests/_output/.gitignore

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
*
2+
!.gitignore

tests/_support/AcceptanceTester.php

Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,26 @@
1+
<?php
2+
namespace App\Tests;
3+
4+
/**
5+
* Inherited Methods
6+
* @method void wantToTest($text)
7+
* @method void wantTo($text)
8+
* @method void execute($callable)
9+
* @method void expectTo($prediction)
10+
* @method void expect($prediction)
11+
* @method void amGoingTo($argumentation)
12+
* @method void am($role)
13+
* @method void lookForwardTo($achieveValue)
14+
* @method void comment($description)
15+
* @method \Codeception\Lib\Friend haveFriend($name, $actorClass = NULL)
16+
*
17+
* @SuppressWarnings(PHPMD)
18+
*/
19+
class AcceptanceTester extends \Codeception\Actor
20+
{
21+
use _generated\AcceptanceTesterActions;
22+
23+
/**
24+
* Define custom actions here
25+
*/
26+
}

tests/_support/FunctionalTester.php

Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,26 @@
1+
<?php
2+
namespace App\Tests;
3+
4+
/**
5+
* Inherited Methods
6+
* @method void wantToTest($text)
7+
* @method void wantTo($text)
8+
* @method void execute($callable)
9+
* @method void expectTo($prediction)
10+
* @method void expect($prediction)
11+
* @method void amGoingTo($argumentation)
12+
* @method void am($role)
13+
* @method void lookForwardTo($achieveValue)
14+
* @method void comment($description)
15+
* @method \Codeception\Lib\Friend haveFriend($name, $actorClass = NULL)
16+
*
17+
* @SuppressWarnings(PHPMD)
18+
*/
19+
class FunctionalTester extends \Codeception\Actor
20+
{
21+
use _generated\FunctionalTesterActions;
22+
23+
/**
24+
* Define custom actions here
25+
*/
26+
}

tests/_support/Helper/Acceptance.php

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
<?php
2+
namespace App\Tests\Helper;
3+
4+
// here you can define custom actions
5+
// all public methods declared in helper class will be available in $I
6+
7+
class Acceptance extends \Codeception\Module
8+
{
9+
10+
}

tests/_support/Helper/Functional.php

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
<?php
2+
namespace App\Tests\Helper;
3+
4+
// here you can define custom actions
5+
// all public methods declared in helper class will be available in $I
6+
7+
class Functional extends \Codeception\Module
8+
{
9+
10+
}

tests/_support/Helper/Unit.php

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
<?php
2+
namespace App\Tests\Helper;
3+
4+
// here you can define custom actions
5+
// all public methods declared in helper class will be available in $I
6+
7+
class Unit extends \Codeception\Module
8+
{
9+
10+
}

tests/_support/UnitTester.php

Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,26 @@
1+
<?php
2+
namespace App\Tests;
3+
4+
/**
5+
* Inherited Methods
6+
* @method void wantToTest($text)
7+
* @method void wantTo($text)
8+
* @method void execute($callable)
9+
* @method void expectTo($prediction)
10+
* @method void expect($prediction)
11+
* @method void amGoingTo($argumentation)
12+
* @method void am($role)
13+
* @method void lookForwardTo($achieveValue)
14+
* @method void comment($description)
15+
* @method \Codeception\Lib\Friend haveFriend($name, $actorClass = NULL)
16+
*
17+
* @SuppressWarnings(PHPMD)
18+
*/
19+
class UnitTester extends \Codeception\Actor
20+
{
21+
use _generated\UnitTesterActions;
22+
23+
/**
24+
* Define custom actions here
25+
*/
26+
}

tests/_support/_generated/.gitignore

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
*
2+
!.gitignore

tests/acceptance.suite.yml

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
# Codeception Test Suite Configuration
2+
#
3+
# Suite for acceptance tests.
4+
# Perform tests in browser using the WebDriver or PhpBrowser.
5+
# If you need both WebDriver and PHPBrowser tests - create a separate suite.
6+
7+
actor: AcceptanceTester
8+
modules:
9+
enabled:
10+
- PhpBrowser:
11+
url: http://localhost/myapp
12+
- \App\Tests\Helper\Acceptance

tests/acceptance/.gitkeep

Whitespace-only changes.

tests/functional.suite.yml

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
# Codeception Test Suite Configuration
2+
#
3+
# Suite for functional tests
4+
# Emulate web requests and make application process them
5+
# Include one of framework modules (Symfony2, Yii2, Laravel5) to use it
6+
# Remove this suite if you don't use frameworks
7+
8+
actor: FunctionalTester
9+
modules:
10+
enabled:
11+
- Symfony:
12+
app_path: 'src'
13+
environment: 'tests'
14+
- \App\Tests\Helper\Functional

tests/functional/.gitkeep

Whitespace-only changes.

tests/unit.suite.yml

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
# Codeception Test Suite Configuration
2+
#
3+
# Suite for unit or integration tests.
4+
5+
actor: UnitTester
6+
modules:
7+
enabled:
8+
- Asserts
9+
- \App\Tests\Helper\Unit

tests/unit/.gitkeep

Whitespace-only changes.

0 commit comments

Comments
 (0)