Skip to main content

codeception测试

· One min read

install

php codecept.phar bootstrap --namespace project1_tests
php codecept.phar bootstrap

/qr/tests/_bootstrap.php

require(__DIR__ . '../../aaaa/phpqrcode.php');

/qr/tests/unit.suite.yml

class_name: UnitTester
coverage:
enabled: true
white_list:
include:
- ../aaaa/*
exclude:
- ../tests/*
modules:
enabled:
- Asserts
- \project1_tests\Helper\Unit

run

php codecept.phar generate:test unit HelloWorld
php codecept.phar run unit HelloWorldTest
php codecept.phar run unit --coverage --coverage-html