Commit 2bff108e authored by Tobias Munk's avatar Tobias Munk

updated testing

parent 49f477bb
Pipeline #10479 failed with stages
in 15 seconds
......@@ -54,8 +54,15 @@ Run package update in container
$ yii help
## Test
cd tests
cp .env-dist .env
Run tests in codeception (`forrest`) container
$ codecept run
docker-compose run forrest run
> :info: This is equivalent to `codecept run` inside the tester container
### CLI
......
......@@ -12,10 +12,5 @@ settings:
extensions:
enabled:
- Codeception\Extension\RunFailed
modules:
config:
Db:
dsn: ''
user: ''
password: ''
dump: tests/codeception/_data/dump.sql
config:
test_entry_url: http://web:80/index.php
\ No newline at end of file
COMPOSE_PROJECT_NAME=test-yii2-app
COMPOSE_FILE=../docker-compose.yml:./docker-compose.test.yml
\ No newline at end of file
COMPOSE_FILE=../docker-compose.yml:./docker-compose.test.yml
STACK_PHP_IMAGE=dmstr/yii2-app
\ No newline at end of file
<?php
/**
* @link http://www.diemeisterei.de/
* @copyright Copyright (c) 2016 diemeisterei GmbH, Stuttgart
*
* For the full copyright and license information, please view the LICENSE
* file that was distributed with this source code.
*/
$_SERVER['SCRIPT_FILENAME'] = YII_TEST_ENTRY_FILE;
$_SERVER['SCRIPT_NAME'] = YII_TEST_ENTRY_URL;
$_SERVER['HOST_NAME'] = 'web';
// TODO: Functional tests load CLI config by default, these are "web-overrides"
$applicationType = 'web';
return yii\helpers\ArrayHelper::merge(
require(__DIR__ . '/../../../src/config/main.php'),
[
'components' => [
'request' => [
'cookieValidationKey' => 'FUNCTIONAL_TESTING'
],
]
]
);
\ No newline at end of file
<?php
/**
* 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
*/
}
<?php //[STAMP] 19539257036018fbf13475beeeb1c2f5
<?php //[STAMP] efa60a632309a7a8ed739cd59858eef3
namespace _generated;
// This class was automatically generated by build task
......
# Codeception Test Suite Configuration
#
# Suite for functional (integration) tests
# Emulate web requests and make application process them
# Include one of framework modules (Symfony2, Yii2, Laravel5) to use it
class_name: FunctionalTester
modules:
enabled:
# add framework module here
#- \Helper\Functional
- Filesystem
- Yii2
config:
Yii2:
configFile: 'tests/codeception/_config/test.php'
<?php
// @group mandatory
$I = new FunctionalTester($scenario);
$I->wantTo('ensure that error page works');
$I->amOnPage('/_this_page_does_not_exist_');
$I->seeResponseCodeIs(404);
$I->see('Not Found');
<?php
$config = require(dirname(__DIR__) . '/_config/test.php');
new yii\web\Application($config);
version: '2'
services:
php:
codecept:
image: codeception/codeception
environment:
- YII_ENV=test
volumes:
- ./tests:/app/tests
- ./codeception.yml:/app/codeception.yml
- ./:/project
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment