I used to write several projects and use the golang (revel framework). It is very convenient to write tests in it. For example, to test whether an action works properly: {code ...} now the project uses the phpyii framework and wants to perform such basic tests. No similar method is found. I don't know the http in php... I used to write several projects and use the golang (revel framework). It is very convenient to write tests in it, for example, to test whether an action works properly:
Func (t * UserTest) TestInfo () {// directly access t. get ("/user/info/") // check whether the HTTP code is 200 by default. // check whether the return header is correct. assertContentType ("text/html; charset = UTF-8") // obtain the returned content res: = string (t. responseBody) // compare the returned content to do ...}
Now the project uses the php yii framework and wants to perform such basic tests. No similar method is found.
I don't know how to write and test these http methods in php?
Reply content:
I used to write several projects and use the golang (revel framework). It is very convenient to write tests in it, for example, to test whether an action works properly:
Func (t * UserTest) TestInfo () {// directly access t. get ("/user/info/") // check whether the HTTP code is 200 by default. // check whether the return header is correct. assertContentType ("text/html; charset = UTF-8") // obtain the returned content res: = string (t. responseBody) // compare the returned content to do ...}
Now the project uses the php yii framework and wants to perform such basic tests. No similar method is found.
I don't know how to write and test these http methods in php?
In general, php uses the phpunit test framework for testing.
In fact, the official yii solution also uses phpunit (see here)
Here is a tutorial on how to use it.
Currently, phpunit is a better test.
It is estimated that you want the selenium of phpunit, but it has never been used and cannot provide more help.
Https://netbeans.org/kb/docs/php/phpunit_zh_CN.html#selenium