UnionOfRAD/lithium — pull request #870 by jails (2013-03-27 22:03:42+00:00)
Title: Refactor/integration tests

So, inhale deeply...

Looks like a bit intrusive at first glance, but the integration tests was forsaken since a long time ago and the update is pretty strong.

1 - `li3_sqltools`:
After thinking a while about an alternative, I came to the conclusion that I can't refactor integration tests at a high level w/o having a minimal schema support for database adapters. Dealing with sql files rise the complexity for simply "boostraping" a new test case.
With PHP 5.4 it would be possible to keep it as an independant library thanks to `traits`, but I didn't see any viable alternative with the 5.3.
So I leave schema tests as separate files:
- MySqlTestSchema.php
- PostgreSqlTestSchema.php
- Sqlite3TestSchema.php
To be easier to "unplug" if an alternative to the support of `createSchema`/`dropSchema` by the database core adapter is founded.

2 - I love poneys

3 - Some bugfix to Sqlite3 has been done

4 - I included #865 to the core

5 - `CoucDB`
The way this database must be used is a bit awkward to my opinion. Indeed unlike `MongoDB` you need to create the database first.

Use case with a model using CouchDB:
```php
//You need to create the database first
Images::connection()->connection->put('name_of_the_database');
$entity = Images::create(...)
$entity->save();
Images::remove();
//Damn the database have been deleted I need to recreate it
Images::connection()->connection->put('name_of_the_database');
$entity = Images::create(...)
$entity->save();
```
This default behavior of `CouchDB` is imo not that fun. So I decide to add an "auto build database" on create to the adpater. This mean if a query fail because of unexisting database, it'll automatically create the required database and executing the query again. @gwoo can take a look at it a960d89374665b80cb3bbba8c91883c3556e45c6 and give me your opinion ?

Also fixed a bug here 322bb844fe74cd3452c4d8e14ee04441ad409fed.

6 - I added some 'hints' for data sources.

7 - I added a "gallery" fixture with models & datas

8 - Reducing the number of models and mock of models.

9 - Moved adapter tests to integration tests

10 - Otherwise simple refactoring.

Since a lot of refactoring have been done, the commits diff are pretty difficult to read, however they are "well separated"