windwalker-io / joomla-rad

Windwalker RAD framework for Joomla CMS
http://rad.windwalker.io/
28 stars 15 forks source link

[Doc] How to run Unittest #151

Open asika32764 opened 8 years ago

asika32764 commented 8 years ago

This instruction should be write to a standard document later

Test Environment

Joomla test bootstrap https://github.com/joomla/joomla-cms/blob/staging/tests/unit/bootstrap.php

Clone a Test Windwalker package

$ composer create-project windwalker/joomla-rad libraries/windwalker dev-staging
...
Do you want to remove the existing VCS (.git, .svn..) history? [Y,n]? n

$ cd libraries/windwalker
$ git remote add {your_remote} git@github.com:smstw/windwalker-joomla-rad.git
$ git fetch {your_remote} dev-2.1:dev-2.1
$ git checkout dev-2.1
$ composer install

Test Class

Use this command to geneate Test Classes

php bin/windwalker generator test <Folder> <Class> 

For example

php bin/windwalker generator test Helper ModalHelper

It will generate a test class in test/Helper/ModalHelper

asika32764 commented 8 years ago

https://github.com/smstw/windwalker-joomla-rad/issues/14