forked from Codeception/Codeception
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Davert
committed
Apr 5, 2013
1 parent
5caae0e
commit fd508eb
Showing
3 changed files
with
2 additions
and
34 deletions.
There are no files selected for viewing
Binary file not shown.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -30,30 30,8 @@ $I->seeInCurrentUrl('pages/tree-of-life-movie-review'); // slug is generated | |
$I->seeInDatabase('pages', array('title' => 'Tree of Life Movie Review')); // data is stored in database | ||
?> | ||
``` | ||
Ok, as for unit test similar approach may seem weird, but... | ||
|
||
Take a look at this: | ||
|
||
#### Sample unit test | ||
|
||
``` php | ||
<?php | ||
class UserControllerCest { | ||
public $class = 'UserController'; | ||
|
||
public function createAction(CodeGuy $I) | ||
{ | ||
$I->haveFakeClass($userController = Stub::makeEmptyExcept('UserController')); | ||
$I->executeTestedMethodOn($userController, array('username' => 'MilesDavis', 'email' => '[email protected]')) | ||
$I->seeResultEquals(true) | ||
$I->seeMethodInvoked($userController, 'renderHtml') | ||
$I->seeInDatabase('users', array('username' => 'MilesDavis')); | ||
} | ||
} | ||
?> | ||
``` | ||
|
||
Anyway, if you don't really like writing unit tests in DSL, Codeception can run PHPUnit tests natively. | ||
For unit testing you can stay on classic PHPUnit tests, as Codeception can run them too. | ||
|
||
## Documentation | ||
|
||
|
@@ -63,14 41,6 @@ Documentation is currently included within the project. Look for it in the 'docs | |
|
||
## Installation | ||
|
||
### PEAR | ||
Install latest PEAR package from GitHub: | ||
|
||
``` | ||
pear channel-discover codeception.com/pear | ||
pear install codeception/Codeception | ||
``` | ||
|
||
### Phar | ||
|
||
Download [codecept.phar](https://github.com/Codeception/Codeception/raw/master/package/codecept.phar) | ||
|
@@ -105,4 75,4 @@ See Documentation for more information. | |
MIT | ||
|
||
(c) Michael Bodnarchuk "Davert" | ||
2011-2012 | ||
2011-2013 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters