|
3 | 3 | <head> |
4 | 4 | <meta http-equiv="Content-Type" content="text/html; charset=utf-8" /> |
5 | 5 | <meta name="title" content="Codeception - BDD-style PHP testing framework" /> |
6 | | - <title> Codeception Collection of symfony framework tools - Symfohub: useful libs for symfony frameworks</title> |
| 6 | + <title> Codeception - BDD-style PHP testing. Collection of symfony framework tools - Symfohub: useful libs for symfony frameworks</title> |
7 | 7 | <link rel="shortcut icon" href="/images/favicon.png" /> |
8 | 8 | <link rel="stylesheet" type="text/css" media="screen" href="/css/screen.css" /> |
9 | 9 | <link rel="stylesheet" type="text/css" media="screen" href="/css/twilight.css" /> |
|
36 | 36 | </div> |
37 | 37 |
|
38 | 38 | <div> |
39 | | - --- |
40 | | -layout: default |
41 | | -title: Codeception - BDD-style PHP testing. |
42 | | ---- |
| 39 | + <h1>Codeception</h1> |
43 | 40 |
|
44 | | -# Codeception |
45 | | - |
46 | | -Codeception is new PHP full-stack testing framework. |
| 41 | +<p>Codeception is new PHP full-stack testing framework. |
47 | 42 | Inspired by BDD, it provides you absolutely new way for writing acceptance, functional and even unit tests. |
48 | | -Powered by PHPUnit 3.6. |
| 43 | +Powered by PHPUnit 3.6.</p> |
49 | 44 |
|
50 | | -[](http://travis-ci.org/Codeception/codeception) |
| 45 | +<p><a href="http://travis-ci.org/Codeception/codeception"><img src="https://secure.travis-ci.org/Codeception/Codeception.png?branch=master" alt="Build Status" /></a></p> |
51 | 46 |
|
52 | | -### In a Glance |
| 47 | +<h3>In a Glance</h3> |
53 | 48 |
|
54 | | -Describe what you test and how you test it. Use PHP to write descriptions faster. |
| 49 | +<p>Describe what you test and how you test it. Use PHP to write descriptions faster.</p> |
55 | 50 |
|
56 | | -Run tests and see what actions were taken and what results were seen. |
| 51 | +<p>Run tests and see what actions were taken and what results were seen.</p> |
57 | 52 |
|
58 | | -#### Sample acceptance test |
| 53 | +<h4>Sample acceptance test</h4> |
59 | 54 |
|
60 | | -``` php |
61 | | -<?php |
| 55 | +<p>``` php |
| 56 | +<?php</p> |
62 | 57 |
|
63 | | -$I = new TestGuy($scenario); |
| 58 | +<p>$I = new TestGuy($scenario); |
64 | 59 | $I->wantTo('create wiki page'); |
65 | 60 | $I->amOnPage('/'); |
66 | 61 | $I->click('Pages'); |
67 | 62 | $I->click('New'); |
68 | 63 | $I->see('New Page'); |
69 | | -$I->submitForm('#pageForm', array('page' => array( |
70 | | - 'title' => 'Tree of Life Movie Review', |
71 | | - 'body' => 'Next time don\'t let Hollywood create arthouse =) ' |
72 | | -))); |
| 64 | +$I->submitForm('#pageForm', array('page' => array(</p> |
| 65 | + |
| 66 | +<pre><code>'title' => 'Tree of Life Movie Review', |
| 67 | +'body' => 'Next time don\'t let Hollywood create arthouse =) ' |
| 68 | +</code></pre> |
| 69 | + |
| 70 | +<p>))); |
73 | 71 | $I->see('page created'); // notice generated |
74 | 72 | $I->see('Tree of Life Movie Review','h1'); // head of page of is our title |
75 | 73 | $I->seeInCurrentUrl('pages/tree-of-life-mobie-review'); // slug is generated |
76 | 74 | $I->seeInDatabase('pages', array('title' => 'Tree of Life Movie Review')); // data is stored in database |
77 | 75 | ?> |
78 | 76 | ``` |
79 | 77 | Ok, as for unit test similar approach may seem weired, but... |
80 | | -Take a look at this: |
81 | | - |
82 | | -#### Sample unit test |
83 | | - |
84 | | -``` php |
85 | | -<?php |
86 | | -class UserControllerCest { |
87 | | - public $class = 'UserController'; |
88 | | - |
89 | | - public function createAction(CodeGuy $I) |
90 | | - { |
91 | | - $I->haveFakeClass($userController = Stub::make('UserController')); |
92 | | - $I- >executeTestedMethodOn($userController , array('username' => 'MilesDavis', 'email' => '[email protected]')) |
93 | | - ->seeResultEquals(true) |
94 | | - ->seeMethodInvoked($userController, 'renderHtml') |
95 | | - ->seeInDabatase('users', array('username' => 'MilesDavis')); |
96 | | - } |
| 78 | +Take a look at this:</p> |
| 79 | + |
| 80 | +<h4>Sample unit test</h4> |
| 81 | + |
| 82 | +<p>``` php |
| 83 | +<?php |
| 84 | +class UserControllerCest {</p> |
| 85 | + |
| 86 | +<pre><code>public $class = 'UserController'; |
| 87 | + |
| 88 | +public function createAction(CodeGuy $I) |
| 89 | +{ |
| 90 | + $I->haveFakeClass($userController = Stub::make('UserController')); |
| 91 | + $I->executeTestedMethodOn($userController, array('username' => 'MilesDavis', 'email' => '[email protected]')) |
| 92 | + ->seeResultEquals(true) |
| 93 | + ->seeMethodInvoked($userController, 'renderHtml') |
| 94 | + ->seeInDabatase('users', array('username' => 'MilesDavis')); |
97 | 95 | } |
98 | | -?> |
| 96 | +</code></pre> |
99 | 97 |
|
100 | | -``` |
| 98 | +<p>} |
| 99 | +?></p> |
101 | 100 |
|
102 | | -Anyway, If you don't really like writing unit tests in DSL, Codeceptance can run PHPUnit tests natively. |
| 101 | +<p>```</p> |
103 | 102 |
|
104 | | -## Documentation |
| 103 | +<p>Anyway, If you don't really like writing unit tests in DSL, Codeceptance can run PHPUnit tests natively.</p> |
105 | 104 |
|
106 | | -[Documentation on Github](https://github.com/Codeception/Codeception/tree/master/docs) |
| 105 | +<h2>Documentation</h2> |
107 | 106 |
|
108 | | -Documentation is currently bounded with project. Look for it in 'docs' directory. |
| 107 | +<p><a href="https://github.com/Codeception/Codeception/tree/master/docs">Documentation on Github</a></p> |
109 | 108 |
|
110 | | -## Installation |
| 109 | +<p>Documentation is currently bounded with project. Look for it in 'docs' directory.</p> |
111 | 110 |
|
112 | | -### PEAR |
113 | | -Install latest PEAR package from GitHub: |
| 111 | +<h2>Installation</h2> |
114 | 112 |
|
115 | | -``` |
| 113 | +<h3>PEAR</h3> |
| 114 | + |
| 115 | +<p>Install latest PEAR package from GitHub:</p> |
| 116 | + |
| 117 | +<p><code> |
116 | 118 | pear channel-discover codeception.github.com/pear |
117 | 119 | pear install codeception/Codeception |
118 | | -``` |
| 120 | +</code></p> |
119 | 121 |
|
120 | | -### Phar |
| 122 | +<h3>Phar</h3> |
121 | 123 |
|
122 | | -Download [codecept.phar](https://github.com/Codeception/Codeception/raw/master/package/codecept.phar) |
| 124 | +<p>Download <a href="https://github.com/Codeception/Codeception/raw/master/package/codecept.phar">codecept.phar</a></p> |
123 | 125 |
|
124 | | -Copy it into your project. |
125 | | -Run CLI utility: |
| 126 | +<p>Copy it into your project. |
| 127 | +Run CLI utility:</p> |
126 | 128 |
|
127 | | -``` |
| 129 | +<p><code> |
128 | 130 | php codecept.phar |
129 | | -``` |
| 131 | +</code></p> |
130 | 132 |
|
131 | | -## Getting Started |
| 133 | +<h2>Getting Started</h2> |
132 | 134 |
|
133 | | -If you sucessfully installed Codeception, run this commands: |
| 135 | +<p>If you sucessfully installed Codeception, run this commands:</p> |
134 | 136 |
|
135 | | -``` |
| 137 | +<p><code> |
136 | 138 | codecept install |
137 | | -``` |
| 139 | +</code></p> |
138 | 140 |
|
139 | | -this will install all dependency tools like PHPUnit and Mink |
| 141 | +<p>this will install all dependency tools like PHPUnit and Mink</p> |
140 | 142 |
|
141 | | -``` |
| 143 | +<p><code> |
142 | 144 | codecept bootstrap |
143 | | -``` |
| 145 | +</code></p> |
144 | 146 |
|
145 | | -this will create default directory structure and default test suites |
| 147 | +<p>this will create default directory structure and default test suites</p> |
146 | 148 |
|
147 | | -``` |
| 149 | +<p><code> |
148 | 150 | codecept build |
149 | | -``` |
| 151 | +</code></p> |
| 152 | + |
| 153 | +<p>This will generate Guy-classes, in order to make autocomplete works.</p> |
| 154 | + |
| 155 | +<p>See Documentation for more information.</p> |
150 | 156 |
|
151 | | -This will generate Guy-classes, in order to make autocomplete works. |
| 157 | +<h3>License</h3> |
152 | 158 |
|
153 | | -See Documentation for more information. |
| 159 | +<p>MIT</p> |
154 | 160 |
|
155 | | -### License |
156 | | -MIT |
| 161 | +<p>(c) Michael Bodnarchuk "Davert" |
| 162 | +2011</p> |
157 | 163 |
|
158 | | -(c) Michael Bodnarchuk "Davert" |
159 | | -2011 |
160 | 164 | </div> |
161 | 165 | </div> |
162 | 166 | <div class="sidebar"> |
|
0 commit comments