Skip to content

Commit

Permalink
Merge pull request #2 from Lucaszz/redesign
Browse files Browse the repository at this point in the history
Redesign
  • Loading branch information
lzakrzewski committed Jan 10, 2016
2 parents 330e32a + 7e6c6e5 commit 59d827a
Show file tree
Hide file tree
Showing 46 changed files with 1,292 additions and 1,054 deletions.
8 changes: 6 additions & 2 deletions .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,11 +4,15 @@ php:
- 5.4
- 5.5
- 5.6
- 7.0
- hhvm

before_install:
- composer self-update
- composer install

script:
- phpunit --configuration phpunit.xml.dist --testsuite unit
- phpunit --configuration phpunit.xml.dist --testsuite integration
- vendor/bin/phpunit --coverage-clover build/logs/clover.xml

after_script:
- vendor/bin/coveralls
5 changes: 5 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
# Changelog

## 1.1.0 (2016-01-10)
- Folders rearranged,
- API of `DoctrineDatabaseBackup` class updated.
10 changes: 5 additions & 5 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# DoctrineDatabaseBackup

[![Build Status](https://travis-ci.org/Lucaszz/DoctrineDatabaseBackup.svg)](https://travis-ci.org/Lucaszz/DoctrineDatabaseBackup) [![Latest Stable Version](https://poser.pugx.org/lucaszz/doctrine-database-backup/v/stable)](https://packagist.org/packages/lucaszz/doctrine-database-backup) [![Total Downloads](https://poser.pugx.org/lucaszz/doctrine-database-backup/downloads)](https://packagist.org/packages/lucaszz/doctrine-database-backup)
[![Build Status](https://travis-ci.org/Lucaszz/DoctrineDatabaseBackup.svg)](https://travis-ci.org/Lucaszz/DoctrineDatabaseBackup) [![Latest Stable Version](https://poser.pugx.org/lucaszz/doctrine-database-backup/v/stable)](https://packagist.org/packages/lucaszz/doctrine-database-backup) [![Total Downloads](https://poser.pugx.org/lucaszz/doctrine-database-backup/downloads)](https://packagist.org/packages/lucaszz/doctrine-database-backup) [![Coverage Status](https://coveralls.io/repos/Lucaszz/DoctrineDatabaseBackup/badge.svg?branch=master&service=github)](https://coveralls.io/github/Lucaszz/DoctrineDatabaseBackup?branch=master)

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.
Expand Down Expand Up @@ -34,7 +34,7 @@ Installation
Require the library with composer:

```sh
composer require lucaszz/doctrine-database-backup "dev-master"
composer require lucaszz/doctrine-database-backup "~1.1"
```

Basic usage (PHPUnit example)
Expand Down Expand Up @@ -66,17 +66,17 @@ protected function setUp()
$this->entityManager = $this->createEntityManager();
$backup = new DoctrineDatabaseBackup($this->entityManager);

if (!$backup->getExecutor()->isBackupCreated()) {
if (!$backup->getBackup()->isBackupCreated()) {
$backup->getPurger()->purge();

//your fixtures
$this->entityManager->persist(new TestProduct('Iron', 99));
$this->entityManager->flush();

$backup->getExecutor()->create();
$backup->getBackup()->create();
}

$backup->getExecutor()->restore();
$backup->getBackup()->restore();
}
```

Expand Down
3 changes: 2 additions & 1 deletion composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,7 @@
},
"require-dev": {
"phpunit/phpunit" : "~4.8",
"mikey179/vfsStream": "~1"
"mikey179/vfsStream": "~1",
"satooshi/php-coveralls": "~1.0"
}
}
9 changes: 2 additions & 7 deletions src/Backup/Executor/Executor.php → src/Backup/Backup.php
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
<?php

namespace Lucaszz\DoctrineDatabaseBackup\Backup\Executor;
namespace Lucaszz\DoctrineDatabaseBackup\Backup;

interface Executor
interface Backup
{
/**
* This method checks if backup was created during current PHP process.
Expand All @@ -24,9 +24,4 @@ public function create();
* @throws \RuntimeException
*/
public function restore();

/**
* This method clears backup from memory.
*/
public static function clearMemory();
}
27 changes: 0 additions & 27 deletions src/Backup/Command.php

This file was deleted.

65 changes: 0 additions & 65 deletions src/Backup/DoctrineDatabaseBackup.php

This file was deleted.

100 changes: 0 additions & 100 deletions src/Backup/Executor/MySqlExecutor.php

This file was deleted.

65 changes: 0 additions & 65 deletions src/Backup/Executor/SqliteExecutor.php

This file was deleted.

Loading

0 comments on commit 59d827a

Please sign in to comment.