Skip to content

Commit

Permalink
Readme updated, method order corrected
Browse files Browse the repository at this point in the history
  • Loading branch information
lzakrzewski committed Oct 5, 2015
1 parent 1da5c2b commit d088bbc
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 12 deletions.
7 changes: 4 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ Description
--------

DoctrineDatabaseBackup is simple library for speed up tests in your app.
It could be used for **PHPUnit** tests or **Behat** tests running from command line.
My target was to avoid wasting time for dropping/creating or purging database for each test, so I optimized it.
From my own benchmarks I can see that DoctrineDatabaseBackup can reduce the time of execution tests up to 3 times.

Expand All @@ -21,10 +22,10 @@ Requirements

Features
--------
- It supports SqlitePlatform and MySqlPlatform,
- It supports **SqlitePlatform** and **MySqlPlatform**,
- It can create database backup per PHP process,
- It can clear database in fast way,
- It can restore database from backup in every test,
- It can restore database from backup before every test,
- Because I decided to expose methods "isCreated", "create", "restore" and "clearDatabase" usages of this library can be very various.

Installation
Expand Down Expand Up @@ -59,7 +60,7 @@ Usage (PHPUnit example)
```
[Full working example](https://github.com/Lucaszz/DoctrineDatabaseBackup/blob/master/tests/Integration/ExampleTest.php)

Notice that before first test of PHP process database should be created.
**Notice that before first test of PHP process database should be created.**

Behat example
--------
Expand Down
18 changes: 9 additions & 9 deletions tests/Integration/ExampleTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,15 @@ public function testThatDatabaseIsClearBeforeNextTest()
$this->assertCount(1, $this->entityManager->getRepository('\Lucaszz\DoctrineDatabaseBackup\tests\Integration\Entity\TestProduct')->findAll());
}

/**
* Before first test of PHP process database should be created.
*/
public static function setUpBeforeClass()
{
$entityManager = self::createEntityManager();
self::setupDatabase($entityManager);
}

/**
* {@inheritdoc}
*/
Expand Down Expand Up @@ -60,15 +69,6 @@ protected function tearDown()
$this->entityManager = null;
}

/**
* Before first test of PHP process database should be created.
*/
public static function setUpBeforeClass()
{
$entityManager = self::createEntityManager();
self::setupDatabase($entityManager);
}

/**
* Example of creating EntityManager.
*/
Expand Down

0 comments on commit d088bbc

Please sign in to comment.