Skip to content

Commit f6fd14f

Browse files
author
Davert
committed
Merge branch 'master' of github.com:Codeception/codeception.github.com
2 parents 2f13e96 + c0789ab commit f6fd14f

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

56 files changed

+5088
-437
lines changed

_includes/guides.html

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
<li><a href="/docs/01-Introduction">Introduction</a></li><li><a href="/docs/02-GettingStarted">Getting Started</a></li><li><a href="/docs/03-ModulesAndHelpers">Modules And Helpers</a></li><li><a href="/docs/04-AcceptanceTests">Acceptance Tests</a></li><li><a href="/docs/05-FunctionalTests">Functional Tests</a></li><li><a href="/docs/06-UnitTests">Unit Tests</a></li><li><a href="/docs/07-UnitTestsInScenarios">Unit Tests In Scenarios</a></li><li><a href="/docs/08-CestFormat">Cest Format</a></li><li><a href="/docs/09-Data">Data</a></li><li><a href="/docs/10-WebServices">Web Services</a></li><li><a href="/docs/11-Codecoverage">Codecoverage</a></li>
1+
<li><a href="/docs/01-Introduction">Introduction</a></li><li><a href="/docs/02-GettingStarted">Getting Started</a></li><li><a href="/docs/03-ModulesAndHelpers">Modules And Helpers</a></li><li><a href="/docs/04-AcceptanceTests">Acceptance Tests</a></li><li><a href="/docs/05-FunctionalTests">Functional Tests</a></li><li><a href="/docs/06-UnitTests">Unit Tests</a></li><li><a href="/docs/07-AdvancedUsage">Advanced Usage</a></li><li><a href="/docs/08-CestFormat">Cest Format</a></li><li><a href="/docs/09-Data">Data</a></li><li><a href="/docs/10-WebServices">Web Services</a></li><li><a href="/docs/11-Codecoverage">Codecoverage</a></li>

_includes/modules.html

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
<li><a href="/docs/modules/AMQP">AMQP</a></li><li><a href="/docs/modules/Cli">Cli</a></li><li><a href="/docs/modules/Dbh">Dbh</a></li><li><a href="/docs/modules/Db">Db</a></li><li><a href="/docs/modules/Doctrine1">Doctrine1</a></li><li><a href="/docs/modules/Doctrine2">Doctrine2</a></li><li><a href="/docs/modules/Filesystem">Filesystem</a></li><li><a href="/docs/modules/Kohana">Kohana</a></li><li><a href="/docs/modules/Memcache">Memcache</a></li><li><a href="/docs/modules/MongoDb">MongoDb</a></li><li><a href="/docs/modules/PhpBrowser">PhpBrowser</a></li><li><a href="/docs/modules/Redis">Redis</a></li><li><a href="/docs/modules/REST">REST</a></li><li><a href="/docs/modules/Selenium2">Selenium2</a></li><li><a href="/docs/modules/Selenium">Selenium</a></li><li><a href="/docs/modules/SOAP">SOAP</a></li><li><a href="/docs/modules/SocialEngine">SocialEngine</a></li><li><a href="/docs/modules/Symfony1">Symfony1</a></li><li><a href="/docs/modules/Symfony2">Symfony2</a></li><li><a href="/docs/modules/Unit">Unit</a></li><li><a href="/docs/modules/WebDebug">WebDebug</a></li><li><a href="/docs/modules/XMLRPC">XMLRPC</a></li><li><a href="/docs/modules/Yii1">Yii1</a></li><li><a href="/docs/modules/ZF1">ZF1</a></li><li><a href="/docs/modules/ZombieJS">ZombieJS</a></li>
1+
<li><a href="/docs/modules/AMQP">AMQP</a></li><li><a href="/docs/modules/Cli">Cli</a></li><li><a href="/docs/modules/Db">Db</a></li><li><a href="/docs/modules/Dbh">Dbh</a></li><li><a href="/docs/modules/Doctrine1">Doctrine1</a></li><li><a href="/docs/modules/Doctrine2">Doctrine2</a></li><li><a href="/docs/modules/Filesystem">Filesystem</a></li><li><a href="/docs/modules/Kohana">Kohana</a></li><li><a href="/docs/modules/Laravel4">Laravel4</a></li><li><a href="/docs/modules/Memcache">Memcache</a></li><li><a href="/docs/modules/MongoDb">MongoDb</a></li><li><a href="/docs/modules/PhpBrowser">PhpBrowser</a></li><li><a href="/docs/modules/REST">REST</a></li><li><a href="/docs/modules/Redis">Redis</a></li><li><a href="/docs/modules/SOAP">SOAP</a></li><li><a href="/docs/modules/Selenium">Selenium</a></li><li><a href="/docs/modules/Selenium2">Selenium2</a></li><li><a href="/docs/modules/SocialEngine">SocialEngine</a></li><li><a href="/docs/modules/Symfony1">Symfony1</a></li><li><a href="/docs/modules/Symfony2">Symfony2</a></li><li><a href="/docs/modules/Unit">Unit</a></li><li><a href="/docs/modules/WebDebug">WebDebug</a></li><li><a href="/docs/modules/XMLRPC">XMLRPC</a></li><li><a href="/docs/modules/Yii1">Yii1</a></li><li><a href="/docs/modules/ZF1">ZF1</a></li><li><a href="/docs/modules/ZF2">ZF2</a></li><li><a href="/docs/modules/ZombieJS">ZombieJS</a></li>

_layouts/index.html

Lines changed: 4 additions & 27 deletions
Original file line numberDiff line numberDiff line change
@@ -126,7 +126,7 @@ <h4>Do I really need this?</h4>
126126
<h4>Why should I use this instead of PHPUnit?</h4>
127127
<p>Being the most popular unit testing framework PHPUnit has very limited
128128
features for functional testing with
129-
<b>Selenium</b>or other backends. Codeception is
129+
<b>Selenium</b> or other backends. Codeception is
130130
<b>PHPUnit on steroids</b>. Everything you need for testing is built-in and
131131
works just out of the box. No more pain in configuring Selenium, data cleanup, writing XPaths,
132132
and fixtures.
@@ -260,6 +260,7 @@ <h3>Unit Test</h3>
260260

261261
{% highlight php %}
262262
<?php
263+
use \Codeception\Util\Stub;
263264
class UserTest extends \Codeception\TestCase\Test
264265
{
265266
public function testUserSave() {
@@ -279,33 +280,9 @@ <h3>Unit Test</h3>
279280
</p>
280281
<a class="btn" href="/docs/06-UnitTests-TEST"><span class="btn-label">Read more about Unit Tests &rarr;</span></a>
281282

282-
<h4>Scenario-Driven Unit Test</h4>
283-
284-
{% highlight php %}
285-
<?php
286-
class UserControllerCest {
287-
public $class = 'UserController';
288-
289-
public function createAction(CodeGuy $I)
290-
{
291-
$I->haveFakeClass($userController = Stub::makeEmptyExcept('UserController'));
292-
$I->executeTestedMethodOn($userController, array('username' => 'MilesDavis', 'email' => 'miles@davis.com'))
293-
$I->seeResultEquals(true)
294-
$I->seeMethodInvoked($userController, 'renderHtml')
295-
$I->seeInDabatase('users', array('username' => 'MilesDavis'));
296-
}
297-
}
298-
?>
299-
{% endhighlight %}
283+
</div>
284+
</div>
300285

301-
<p>
302-
In this test we describe what classes are used, what methods are executed and what results we expect to see.
303-
Just the same as we did in acceptance tests!
304-
This test documents underlying code and creates mocks in a realtime.
305-
</p>
306286

307-
<a class="btn" href="/docs/07-UnitTestsScenarios"><span class="btn-label">Read more about Scenario-Driven Unit Tests &rarr;</span></a>
308287

309-
</div>
310-
</div>
311288

Lines changed: 78 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,78 @@
1+
---
2+
title: Codeception 1.5.5 and Roadmap Announced
3+
layout: post
4+
date: 2013-02-28 01:03:50
5+
---
6+
7+
Yes, here is a new version of Codception with more features and bugfixes in it.
8+
We have a flexible relase cycle, so the new version comes when we have a set of updates that you might be needed.
9+
We want to say "thank you" for all contributors, and for everyone who helps making Codeption better.
10+
It's always nice to get pull requests or [follow discussions](https://github.com/Codeception/Codeception/issues/) in our issues secition.
11+
So let us sum up the work was done during last 2 weeks and share it with you.
12+
13+
### Use Codeception in Different Places
14+
15+
All codeception commands got `-c` option to provide a custom path to tests.
16+
The exception is `bootstrap` command. It accepts a custom directory as a second argument:
17+
18+
{% highlight bash %}
19+
php codecept.phar bootstrap ~/mynewproject
20+
php codecept.phar generate:cept acceptance Login -c ~/mynewproject
21+
php codecept.phar generate:test unit MyFirstTest -c ~/mynewproject
22+
php codecept.phar run -c ~/mynewproject
23+
php codecept.phar generate:scenarios acceptance -c ~/mynewproject
24+
{% endhighlight %}
25+
26+
Alternatively you may specify path to `codeception.yml` file in `-c` option: `php codecept.phar run -c ~/mynewproject/codeception.yml`
27+
28+
Thus, you don't need to keep your `codecept.phar` in the root of your project anymore. Use `-c` option and one local runner for all your projects.
29+
30+
### Skipping Tests
31+
32+
Skipping and marking tests of incomplete was improved. We did a new solid implementation for it (it was very basic in `1.5.4`).
33+
Now If a test is marked to skip, no modules will be touched.
34+
35+
{% highlight php %}
36+
<?php
37+
$scenario->skip('this is not ready yet, move along');
38+
39+
$I = new WebGuy($scenario);
40+
$I->wanTo('do something, but I would rather not');
41+
$I->amOnPage('/');
42+
//.....
43+
?>
44+
{% endhighlight %}
45+
46+
This feature required to rework some core classes (like Step and TestCase and Scenario) but hopefully we simplified our code.
47+
48+
### Bugfixes
49+
50+
* `acceptPopup` with Selenium 2 does not trigger Exception any more
51+
* error handling was improved to skip blocked with `@` alerts, yet to throw `ErrorException` for notices, warnings, errors.
52+
* ZombieJS configuration was fixed. Now the `url` parameter is required to specify app's local url.
53+
* REST `seeStatusCodeIs` method works correctly with Symfony2 now.
54+
55+
### Update
56+
57+
[redownload](http://codeception.com/thanks.html) your `codeception.phar` for update:
58+
59+
{% highlight bash %}
60+
wget http://codeception.com/codecept.phar -O codecept.phar
61+
{% endhighlight %}
62+
63+
for composer version
64+
65+
{% highlight bash %}
66+
$ php composer.phar update
67+
{% endhighlight %}
68+
69+
## Roadmap
70+
71+
For the first time we will announce the roadmap for Codeception. Actually we need your opinion: what features you'd like to see in new releases, and what things can be postponed. The list below is not a precise plan, but just a list of features we have in mind:
72+
73+
* Make a PageObject pattern first-class citizen in Codeception. Add generators and guides to use PageObjects (for acceptance tests).
74+
* Multiple sessions for tests execution ([see discission on GitHub](https://github.com/Codeception/Codeception/issues/154))
75+
* **Silex**, **Laravel 4**, **Zend Framework 2**, **Drupal 8**, **Phalcon** integrations. The key problem here: we can't do this on our own. We need a real users of these frameworks, to create integration and test it on their projects. We have reworked [functional testing guide](http://codeception.com/docs/05-FunctionalTests) to help you with this. Also use GitHub or personal contacts if you want to make a module.
76+
* **Scenario Unit Tests to be rethinked**. We have 2 options here: dump scenario driven unit tests (or mark them as deprecated) or rework them. Actually we need your real opinion. [Here is an example of what new Cests may look like](https://gist.github.com/DavertMik/5042537). They will dramatically improve the way you work with mocks and stubs in PHP. But will you use it? Please, let us know what you think.
77+
78+
To summarize: we'd appreciate contributions, feedbacks and ideas for next releases.

_posts/2013-03-10-codeception-1-5-6

Lines changed: 86 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,86 @@
1+
---
2+
title: Codeception 1.5.6
3+
layout: post
4+
date: 2013-03-10 01:03:50
5+
---
6+
7+
Codeption 1.5.6 released with varous fixes to Selenium2 module (popups, screenshots) an other bugfixes.
8+
We added a bunch of tests for Selenium2 and they are runnng on TravisCI.
9+
Also, Codeception is now compatble with Symony 2.2. And few features were intrduced.
10+
11+
Very basic implementation of fixtures was added to Db and Mongo modules.
12+
Now you can write something like:
13+
14+
{% highlight php %}
15+
<?php
16+
// for Db
17+
$I->haveInDatabase('users', array('name' => 'davert'));
18+
// for Mongo
19+
$I->haveInCollection('users', array('name' => 'davert'));
20+
?>
21+
{% endhighlight %}
22+
23+
to add data for a test. For Db module, the inserted record will be cleaned up on text test, even If `cleanup` option is set to false. So `haveInDatabase` method cleans data after itself.
24+
Something similar exists for Doctrine2 module. Yet, it looks not like for Db and Mongo implementation:
25+
26+
{% highlight php %}
27+
<?php
28+
$I->persistEntity(new \Entity\User, array('name' => 'Miles'));
29+
{% endhighlight %}
30+
31+
### Basic Fixtures
32+
33+
Very basic implementation of fixtures was added to Db and Mongo modules.
34+
Now you can write something like:
35+
36+
{% highlight php %}
37+
<?php
38+
// for Db
39+
$I->haveInDatabase('users', array('name' => 'davert'));
40+
// for Mongo
41+
$I->haveInCollection('users', array('name' => 'davert'));
42+
?>
43+
{% endhighlight %}
44+
45+
to add data for a test. For Db module, the inserted record will be cleaned up on text test, even If `cleanup` option is set to false. So `haveInDatabase` method cleans data after itself.
46+
Something similar exists for Doctrine2 module. Yet, it looks not like for Db and Mongo implementation:
47+
48+
{% highlight php %}
49+
<?php
50+
$I->persistEntity(new \Entity\User, array('name' => 'Miles'));
51+
{% endhighlight %}
52+
53+
### Error Handling
54+
55+
From now on you can set custom error handling parameters per suite or globally.
56+
57+
{% highlight yaml %}
58+
class_name: WebGuy
59+
modules:
60+
enabled: [PhpBrowser, WebHelper]
61+
error_level: "E_ALL & ~E_STRICT & ~E_DEPRECATED"
62+
{% endhighlight %}
63+
64+
Actually, `E_ALL & ~E_STRICT & ~E_DEPRECATED` is default error level for now. This may be changed in future.
65+
66+
### Bugfixes
67+
68+
* popups and modals in Selenium2 are fully tested and work correctly now
69+
* screenshots in Selenium2 module is saved correctly
70+
* `seeInField` method works correctly even if field is not in form
71+
* fix to AMQP module to push message to queue
72+
* Symfony 2.2 compatibility
73+
74+
### Update
75+
76+
[redownload](http://codeception.com/thanks.html) your `codeception.phar` for update:
77+
78+
{% highlight bash %}
79+
wget http://codeception.com/codecept.phar -O codecept.phar
80+
{% endhighlight %}
81+
82+
for composer version
83+
84+
{% highlight bash %}
85+
$ php composer.phar update
86+
{% endhighlight %}
Lines changed: 66 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,66 @@
1+
---
2+
title: Codeception 1.5.6
3+
layout: post
4+
date: 2013-03-10 01:03:50
5+
---
6+
7+
Codeption 1.5.6 released with varous fixes to Selenium2 module (popups, screenshots) an other bugfixes.
8+
We added a bunch of tests for Selenium2 and they are runnng on TravisCI.
9+
Also, Codeception is now compatble with Symony 2.2. And few features were intrduced.
10+
11+
### Basic Fixtures
12+
13+
Very basic implementation of fixtures was added to Db and Mongo modules.
14+
Now you can write something like:
15+
16+
{% highlight php %}
17+
<?php
18+
// for Db
19+
$I->haveInDatabase('users', array('name' => 'davert'));
20+
// for Mongo
21+
$I->haveInCollection('users', array('name' => 'davert'));
22+
?>
23+
{% endhighlight %}
24+
25+
to add data for a test. For Db module, the inserted record will be cleaned up on text test, even If `cleanup` option is set to false. So `haveInDatabase` method cleans data after itself.
26+
Something similar exists for Doctrine2 module. Yet, it looks not like for Db and Mongo implementation:
27+
28+
{% highlight php %}
29+
<?php
30+
$I->persistEntity(new \Entity\User, array('name' => 'Miles'));
31+
{% endhighlight %}
32+
33+
### Error Handling
34+
35+
From now on you can set custom error handling parameters per suite or globally.
36+
37+
{% highlight yaml %}
38+
class_name: WebGuy
39+
modules:
40+
enabled: [PhpBrowser, WebHelper]
41+
error_level: "E_ALL & ~E_STRICT & ~E_DEPRECATED"
42+
{% endhighlight %}
43+
44+
Actually, `E_ALL & ~E_STRICT & ~E_DEPRECATED` is default error level for now. This may be changed in future.
45+
46+
### Bugfixes
47+
48+
* popups and modals in Selenium2 are fully tested and work correctly now
49+
* screenshots in Selenium2 module is saved correctly
50+
* `seeInField` method works correctly even if field is not in form
51+
* fix to AMQP module to push message to queue
52+
* Symfony 2.2 compatibility
53+
54+
### Update
55+
56+
[redownload](http://codeception.com/thanks.html) your `codeception.phar` for update:
57+
58+
{% highlight bash %}
59+
wget http://codeception.com/codecept.phar -O codecept.phar
60+
{% endhighlight %}
61+
62+
for composer version
63+
64+
{% highlight bash %}
65+
$ php composer.phar update
66+
{% endhighlight %}
Lines changed: 38 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,38 @@
1+
---
2+
layout: post
3+
title: Scenario Unit Tests Deprecation Announcement
4+
date: 2013-03-18 22:03:50
5+
---
6+
7+
We decided to get rid of the scenario unit tests. The main reason is: the concept was interesting, but current realization is a bit outdated.
8+
It would take to much time to maintain and support them. Hopefully, not to much developers used them anyway ) They are cool if you are dealing with mocks in your tests, but they don't bring any value if you write a plain unit test. We've seen too much improperly written unit tests in Cest format so we'd actually recommend you to switch to classical unittests with codeGuy helpers.
9+
10+
So now recommended are Codeception driven unit tests, in PHPUnit like format:
11+
12+
{% highlight php %}
13+
<?php
14+
class UserTest extends \Codeception\TestCase\Test {
15+
16+
function _before()
17+
{
18+
$this->user = new User();
19+
}
20+
21+
22+
function testUserIsSaved()
23+
{
24+
$this->user->name = 'miles';
25+
$this->user->save();
26+
$this->codeGuy->seeInDatabase('users', array('name' => 'miles'));
27+
}
28+
}
29+
?>
30+
{% endhighlight %}
31+
32+
If you still interested in scenario driven tests, leave your feedback or even propose your concept. [Here is one of them]( https://gist.github.com/DavertMik/5042537)
33+
The real idea behind scenario driven unit tests to have code well described in a human language. This is especially useful when dealing with mocks and stubs. In this case we can implement some 'magic' methods that allows us to simplify manipulation with code and write only definitions. What methods do we need, what methods do we test, what we expect to see. No unnescessary technlical details. Only logic and dependencies.
34+
35+
The Cest format itself is not going to be deprecated. It would be proposed to use in functional or acceptance tests as an alternative. If you like to write tests in a class (rather then plain PHP file), please use Cest format. More announcement comes on this soon. Expect a new vewsion.
36+
37+
Scenario driven tests <strong>will be removed in 1.7 version</strong> of Codeception.
38+
So migrate them to regular unit tests.

0 commit comments

Comments
 (0)
pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy