Skip to content

Commit 8e8bb10

Browse files
committed
Run behat integration tests through app_test.php
1 parent 000abd1 commit 8e8bb10

File tree

3 files changed

+28
-1
lines changed

3 files changed

+28
-1
lines changed

app/config/config_test.yml

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,15 @@ framework:
88
profiler:
99
collect: false
1010

11+
doctrine:
12+
dbal:
13+
driver: pdo_mysql
14+
host: '%database_host%'
15+
port: '%database_port%'
16+
dbname: '%database_name%_test'
17+
user: '%database_user%'
18+
password: '%database_password%'
19+
1120
web_profiler:
1221
toolbar: false
1322
intercept_redirects: false

behat-e2e.yml

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,8 @@
11
# Run java -jar selenium-server-standalone-2.53.1.jar -Dwebdriver.gecko.driver=/usr/bin/firefox
22
# in the background somewhere
3+
#
4+
# ./bin/console doctrine:database:create --env=test
5+
# ./bin/console doctrine:migrations:migrate --env=test
36
default:
47
autoload:
58
- %paths.base%/features
@@ -18,7 +21,7 @@ default:
1821
kernel:
1922
class: AppKernel
2023
Behat\MinkExtension:
21-
base_url: "http://perfi.local"
24+
base_url: "http://perfi.local/app_test.php"
2225
default_session: firefox
2326
sessions:
2427
firefox:

web/app_test.php

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
<?php
2+
3+
use Symfony\Component\HttpFoundation\Request;
4+
use Symfony\Component\Debug\Debug;
5+
6+
/** @var \Composer\Autoload\ClassLoader $loader */
7+
$loader = require __DIR__.'/../app/autoload.php';
8+
Debug::enable();
9+
10+
$kernel = new AppKernel('test', true);
11+
$kernel->loadClassCache();
12+
$request = Request::createFromGlobals();
13+
$response = $kernel->handle($request);
14+
$response->send();
15+
$kernel->terminate($request, $response);

0 commit comments

Comments
 (0)