Open omansour opened 11 years ago
:+1:
:+1:
Here is an implementation of the request feature.
It cannot be merged as is : this patch depends on atoum/atoum#310
It allows to do:
$ app/console atoum AcmeBundle --kernel-env=ci
The default environment is test
and if you do not provide the --kernel-env
argument, the default will be used.
You will still be able to set the kernel environment at a test level if you want/need:
<?php
namespace vendor\FooBundle\Tests\Controller;
use atoum\AtoumBundle\Test\Units\WebTestCase;
use atoum\AtoumBundle\Test\Controller\ControllerTest;
class BarController extends ControllerTest
{
public function testGet()
{
$this
->request(array('debug' => true, 'environment' => 'ci'))
->GET('/demo/' . uniqid())
->hasStatus(404)
->hasCharset('UTF-8')
->hasVersion('1.1')
//...
;
}
}
Here are how the environment is selected:
test
is used--kernel-env
CLI argument, its value is usedenvironment
option of the request
method, its value is used. If the --kernel-env
argument was used, its value is overridden by the environment
option.excellent !
since then atoum/atoum#310 is merged ! :+1:
thanks to you
:tada:
@omansour @KuiKui seems good to me but I would like to get some reviews from others. I'll then merge everything ;)
Good job @jubianchi ;)
@KuiKui @omansour would you mind testing this branch with a real project to confirm that everything works as expected ?
Thanks :kiss:
On va mettre ça en place oui :smile: Par contre, ça risque de prendre quelques jours (surtout avec le Forum PHP au milieu).
@KuiKui aucun soucis ;) si ça vous va, ça me va aussi
pointed by @KuiKui we sometimes uses another environment, like "CI"
but the bundle doesnt allow us to create a test kernel in such environment. We are stucked in "test"