全栈php,Codeception:一个全栈PHP测试框架

Codeception

68747470733a2f2f706f7365722e707567782e6f72672f436f646563657074696f6e2f436f646563657074696f6e2f76657273696f6e2e706e6768747470733a2f2f706f7365722e707567782e6f72672f636f646563657074696f6e2f636f646563657074696f6e2f646f776e6c6f6164732e706e6768747470733a2f2f7363727574696e697a65722d63692e636f6d2f672f436f646563657074696f6e2f436f646563657074696f6e2f6261646765732f7175616c6974792d73636f72652e706e673f623d342e30

Modern PHP Testing for everyone

Codeception is a modern full-stack testing framework for PHP. Inspired by BDD, it provides an absolutely new way of writing acceptance, functional and even unit tests. Powered by PHPUnit.

General

Windows

Webdriver

256f856ab74dbdc68c7b4a0a895da4cd.png

68747470733a2f2f63692e6170707665796f722e636f6d2f6170692f70726f6a656374732f7374617475732f6e746a6a3969347936376431726237793f7376673d74727565

68747470733a2f2f73656d6170686f726563692e636f6d2f6170692f76312f636f646563657074696f6e2f636f646563657074696f6e2f6272616e636865732f332d302f736869656c64735f62616467652e737667

Contributions

At Codeception we are glad to receive contributions from the community. If you want to send additions or fixes to the code or the documentation please check the Contributing guide.

At a Glance

Describe what you test and how you test it. Use PHP to write descriptions faster.

Run tests and see what actions were taken and what results were seen.

Sample test

$I->amOnPage('/');

$I->click('Pages');

$I->click('New');

$I->see('New Page');

$I->submitForm('form#new_page', ['title' => 'Movie Review']);

$I->see('page created'); // notice generated

$I->see('Movie Review','h1'); // head of page of is our title

$I->seeInCurrentUrl('pages/movie-review'); // slug is generated

$I->seeInDatabase('pages', ['title' => 'Movie Review']); // data is stored in database

For unit testing you can stay on classic PHPUnit tests, as Codeception can run them too.

Installation

Composer

php composer.phar require "codeception/codeception"

TODO: Document how to install the modules, e.g.

php composer.phar require "codeception/module-phpbrowser"

Phar

Copy it into your project.

You can also make Codeception an executable and it put it into your $PATH, for instance:

wget http://codeception.com/codecept.phar

chmod +x codecept.phar

sudo mv codecept.phar /usr/local/bin/codecept

You can then run Codecept in the command line using: codecept bootstrap, codecept run, etc

Run CLI utility:

php codecept.phar

Getting Started

After you successfully installed Codeception, run this command:

codecept bootstrap

This will create a default directory structure and default test suites.

Documentation

License

MIT

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值