Skip to content

Commit 12b1231

Browse files
author
jasdeepkhalsa
committed
Updated Readme.md
1 parent cd0d384 commit 12b1231

1 file changed

Lines changed: 46 additions & 5 deletions

File tree

README.md

Lines changed: 46 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
# PHPUnit Skeleton #
2-
_Get up and running with PHPUnit testing easily for your project_
2+
_Get up and running with PHPUnit testing easily for your project with this skeleton_
33

44
* Are you frustrated with trying to install and configure PHPUnit?
55
* Are you wishing you could use just one command and BANG it was all done for you and you could get on with writing your beautiful unit tests?
@@ -9,13 +9,15 @@ Well, I'm happy to let you know that you just need to `clone` this repo and all
99

1010
We have also included a sample PHP class so you can learn a few tricks in how to use PHPUnit in your projects!
1111

12-
# Simple-tastic 3 Step Installation #
12+
## Simple-tastic 3 Step Installation ##
1313
* Open a Terminal. Download the repo with `git clone https://github.com/jasdeepkhalsa/tweet-counter.git`
1414
* `cd` into where you downloaded your repo and run `php composer.phar self-update`
1515
* Now, run `php composer.phar update`
1616

17+
Note: `php` refers to the location of your php executable, if its not on your system's path
18+
1719
## Run PHPUnit ##
18-
* Open up a terminal
20+
* Open a Terminal
1921
* `cd` to your project root
2022
* Type `./vendor/bin/phpunit` and...magic! Tests (should) now be running!
2123

@@ -31,7 +33,46 @@ You should see something like...
3133
3234
OK (4 tests, 4 assertions)
3335

34-
# Credits #
36+
## Customizing PHPUnit Skeleton ##
37+
Once you've successfully installed PHPUnit Skeleton, you'll probably want to customize it to your application.
38+
39+
### How do I change the name of the application? ###
40+
Once you have the name of your application which we shall refer to as `YourApp`, then do the following:
41+
42+
1. First you have to change the entry `Application` in the `composer.json` file to `YourApp`:
43+
44+
>
45+
> {
46+
> "require-dev": {
47+
> "phpunit/phpunit": "3.7.*",
48+
> "phpunit/dbunit": ">=1.2",
49+
> "phpunit/phpunit-selenium": ">=1.2"
50+
> },
51+
> "autoload": {
52+
> "psr-0": {
53+
> "`YourApp`": "lib/"
54+
> }
55+
> }
56+
> }
57+
>
58+
59+
2. Next, rename the following two directories from `Application` to `YourApp`:
60+
* Rename `/lib/Application/` to `/lib/YourApp/`
61+
* Rename `/tests/Application/` to `/tests/YourApp/`
62+
63+
3. Finally update the `namespace` inside the following php files:
64+
* Inside `/lib/YourApp/Example.php` update `namespace Application;` to `namespace YourApp;`
65+
* Inside `/tests/YourApp/ExampleTest.php` update `$this->obj = new Application\Example;` to `$this->obj = new YourApp\Example;`
66+
67+
4. Run `php composer.phar update` again to update the sources
68+
69+
5. Run `./vendor/bin/phpunit` again to make sure all tests are passing again
70+
71+
## Credits ##
3572
* Me and my awesomely laborious efforts in getting to grips with PHPUnit testing
3673
* Constant support from PHP Guru Jujhar Singh from [Buto](http://get.buto.tv/) who also inspired the test case style in the examples
37-
* Class examples inspired from video by Jeffrey Way from [Nettuts+](http://net.tutsplus.com/tutorials/php/better-workflow-in-php-with-composer-namespacing-and-phpunit/)
74+
* Class examples inspired from video by Jeffrey Way from [Nettuts+](http://net.tutsplus.com/tutorials/php/better-workflow-in-php-with-composer-namespacing-and-phpunit/)
75+
76+
## Contact ##
77+
* Email: jasdeep {at} simplyspiritdesign {dot} com
78+
* Twitter: [@JasdeepKhalsa1](http://twitter.com/@JasdeepKhalsa1)

0 commit comments

Comments
 (0)