Repository navigation
Added basic yii support for codeception - #115
Conversation
|
@DavertMik so i added new class(plugins/frameworks/yii/CodeceptionHttpRequest) that must be used in codeception to avoid headers sent, it also handle cookies. I've tested on yii fresh created app, that was created through console by running But dont forget to add in protected/config/main.php in and put this file (from plugins/frameworks/yii/CodeceptionHttpRequest) to components folder under protected, so it will be auto-imported when app starts. |
|
@DavertMik did u test/check it?) |
Added basic yii support for codeception
|
sorry, not yet. Didn't have time last days. Well, let's merge and find out ) |
|
I have: <?php
return CMap::mergeArray(
require(dirname(__FILE__).'/main.php'),
array(
'components'=>array(
'fixture'=>array(
'class'=>'system.test.CDbFixtureManager',
),
'db'=>array(
'connectionString'=>'sqlite:'.dirname(__FILE__).'/../data/blog-test.db',
),
'request' => array(
'class'=> CODECEPTION_LIB_ROOT.'/plugins/frameworks/yii/web/CodeceptionHttpRequest',
),I get:
:( |
|
No, i mean put CodeceptionHttpRequest under the yii application 'request' => array(
'class'=> 'CodeceptionHttpRequest',
),where CodeceptionHttpRequest is a file that located under |
|
@Ragazzo I installed codeception in my Yii Application (Phundament) via composer and I am able to use it out of the box, at least without See this document about Installing Phundament and this one about adding codeception and here are my (combined) Cepts for Phundament. Let me know, if you want to elaborate this. |
|
Well, CodeceptionHttpRequest is only needed in functional tests where all tests are proceed in the codeception internals (without curl just symfony browser-kit), so Yii1 module purpose is to use it in codeception |
|
Thank you so far, I think I need to take a closer look at it. |
|
Ok) feel free to create new issues on codeception repo about some Yii module improvements, bugs, etc. any help or suggestions are really appreciated :) |
|
So I've a question ... my app still creates the default tests from the Yii Web App Skeleton into But AFAIK codeception can at least do the same things for you, like Yii's default test suite, but in a much more convenient way. Would you recommend to replace Yii's default test suite completely with codeception or would it lack some features? |
|
Well, afaik you can place codeception tests anywhere u want (need to check bootstrap config switchers), but as for me i got this structure in protected folder: For now i prefer classic phpunit tests in Yii, thats why i use |
|
I think ... I'll do it the same way, that sounds good, thank you! |
|
Just for the record, I did the following: I've also updated our wiki page. |
This PR provides basic yii and codeception integration. In Codeception\Module\Yii1 there are docs about how to use it and how to patch CHttpRequest. I did tests on basic yii application that was created by
yiic webappand they passed. Scenario that i use is in the Yii1 module docs. So i will later do a gist with those docs and will add link on it in the module description, and i think will provide some debug info for this module like in the codeception docs are written (http://codeception.com/docs/05-FunctionalTests)But i think this one can be merged so other developers will already have working integration and they can modify it or add something new. What do u think @DavertMik ?