Skip to content

Commit

Permalink
Namespace moved
Browse files Browse the repository at this point in the history
  • Loading branch information
lzakrzewski committed Feb 7, 2016
1 parent 59d827a commit 93a209c
Show file tree
Hide file tree
Showing 32 changed files with 99 additions and 99 deletions.
8 changes: 4 additions & 4 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) [![Coverage Status](https://coveralls.io/repos/Lucaszz/DoctrineDatabaseBackup/badge.svg?branch=master&service=github)](https://coveralls.io/github/Lucaszz/DoctrineDatabaseBackup?branch=master)
[![Build Status](https://travis-ci.org/lzakrzewski/DoctrineDatabaseBackup.svg)](https://travis-ci.org/lzakrzewski/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/lzakrzewski/DoctrineDatabaseBackup/badge.svg?branch=master&service=github)](https://coveralls.io/github/lzakrzewski/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 "~1.1"
composer require lzakrzewski/doctrine-database-backup "~1.1"
```

Basic usage (PHPUnit example)
Expand All @@ -53,7 +53,7 @@ protected function setUp()
```

This database setup prepares clear database before every test.
[Full working example](https://github.com/Lucaszz/DoctrineDatabaseBackup/blob/master/tests/Integration/BasicPHPUnitUsageExampleTest.php).
[Full working example](https://github.com/lzakrzewski/DoctrineDatabaseBackup/blob/master/tests/Integration/BasicPHPUnitUsageExampleTest.php).

Advanced usage (PHPUnit example)
--------
Expand Down Expand Up @@ -81,7 +81,7 @@ protected function setUp()
```

This database setup database with your fixtures before every test.
[Full working example](https://github.com/Lucaszz/DoctrineDatabaseBackup/blob/master/tests/Integration/AdvancedPHPUnitUsageExampleTest.php).
[Full working example](https://github.com/lzakrzewski/DoctrineDatabaseBackup/blob/master/tests/Integration/AdvancedPHPUnitUsageExampleTest.php).

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

Expand Down
10 changes: 5 additions & 5 deletions composer.json
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
{
"name": "lucaszz/doctrine-database-backup",
"name": "lzakrzewski/doctrine-database-backup",
"type": "library",
"description": "Doctrine Database Backup",
"require": {
Expand All @@ -10,17 +10,17 @@
"license": "MIT",
"authors": [
{
"name": "lucaszz111",
"email": "lucaszz111@gmail.com"
"name": "lzakrzewski",
"email": "contact@lzakrzewski.com"
}
],
"autoload": {
"psr-4": {
"Lucaszz\\DoctrineDatabaseBackup\\": "src"
"Lzakrzewski\\DoctrineDatabaseBackup\\": "src"
}
},
"autoload-dev": {
"psr-4" : { "Lucaszz\\DoctrineDatabaseBackup\\tests\\" : "tests" }
"psr-4" : { "Lzakrzewski\\DoctrineDatabaseBackup\\tests\\" : "tests" }
},
"require-dev": {
"phpunit/phpunit" : "~4.8",
Expand Down
2 changes: 1 addition & 1 deletion src/Backup/Backup.php
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<?php

namespace Lucaszz\DoctrineDatabaseBackup\Backup;
namespace Lzakrzewski\DoctrineDatabaseBackup\Backup;

interface Backup
{
Expand Down
8 changes: 4 additions & 4 deletions src/Backup/MySqlBackup.php
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
<?php

namespace Lucaszz\DoctrineDatabaseBackup\Backup;
namespace Lzakrzewski\DoctrineDatabaseBackup\Backup;

use Doctrine\DBAL\Connection;
use Lucaszz\DoctrineDatabaseBackup\Command\Command;
use Lucaszz\DoctrineDatabaseBackup\Purger;
use Lucaszz\DoctrineDatabaseBackup\Storage\InMemoryStorage;
use Lzakrzewski\DoctrineDatabaseBackup\Command\Command;
use Lzakrzewski\DoctrineDatabaseBackup\Purger;
use Lzakrzewski\DoctrineDatabaseBackup\Storage\InMemoryStorage;

class MySqlBackup implements Backup
{
Expand Down
6 changes: 3 additions & 3 deletions src/Backup/SqliteBackup.php
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
<?php

namespace Lucaszz\DoctrineDatabaseBackup\Backup;
namespace Lzakrzewski\DoctrineDatabaseBackup\Backup;

use Lucaszz\DoctrineDatabaseBackup\Storage\InMemoryStorage;
use Lucaszz\DoctrineDatabaseBackup\Storage\LocalStorage;
use Lzakrzewski\DoctrineDatabaseBackup\Storage\InMemoryStorage;
use Lzakrzewski\DoctrineDatabaseBackup\Storage\LocalStorage;

class SqliteBackup implements Backup
{
Expand Down
12 changes: 6 additions & 6 deletions src/BackupFactory.php
Original file line number Diff line number Diff line change
@@ -1,15 +1,15 @@
<?php

namespace Lucaszz\DoctrineDatabaseBackup;
namespace Lzakrzewski\DoctrineDatabaseBackup;

use Doctrine\DBAL\Platforms\MySqlPlatform;
use Doctrine\DBAL\Platforms\SqlitePlatform;
use Doctrine\ORM\EntityManager;
use Lucaszz\DoctrineDatabaseBackup\Backup\MySqlBackup;
use Lucaszz\DoctrineDatabaseBackup\Backup\SqliteBackup;
use Lucaszz\DoctrineDatabaseBackup\Command\MysqldumpCommand;
use Lucaszz\DoctrineDatabaseBackup\Storage\InMemoryStorage;
use Lucaszz\DoctrineDatabaseBackup\Storage\LocalStorage;
use Lzakrzewski\DoctrineDatabaseBackup\Backup\MySqlBackup;
use Lzakrzewski\DoctrineDatabaseBackup\Backup\SqliteBackup;
use Lzakrzewski\DoctrineDatabaseBackup\Command\MysqldumpCommand;
use Lzakrzewski\DoctrineDatabaseBackup\Storage\InMemoryStorage;
use Lzakrzewski\DoctrineDatabaseBackup\Storage\LocalStorage;

final class BackupFactory
{
Expand Down
2 changes: 1 addition & 1 deletion src/Command/Command.php
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<?php

namespace Lucaszz\DoctrineDatabaseBackup\Command;
namespace Lzakrzewski\DoctrineDatabaseBackup\Command;

interface Command
{
Expand Down
2 changes: 1 addition & 1 deletion src/Command/MysqldumpCommand.php
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<?php

namespace Lucaszz\DoctrineDatabaseBackup\Command;
namespace Lzakrzewski\DoctrineDatabaseBackup\Command;

use Symfony\Component\Process\Process;

Expand Down
4 changes: 2 additions & 2 deletions src/DoctrineDatabaseBackup.php
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
<?php

namespace Lucaszz\DoctrineDatabaseBackup;
namespace Lzakrzewski\DoctrineDatabaseBackup;

use Doctrine\ORM\EntityManager;
use Lucaszz\DoctrineDatabaseBackup\Backup\Backup;
use Lzakrzewski\DoctrineDatabaseBackup\Backup\Backup;

class DoctrineDatabaseBackup
{
Expand Down
4 changes: 2 additions & 2 deletions src/Purger.php
Original file line number Diff line number Diff line change
Expand Up @@ -10,13 +10,13 @@
* and Jonathan H. Wage <[email protected]>, Benjamin Eberlei <[email protected]>
*/

namespace Lucaszz\DoctrineDatabaseBackup;
namespace Lzakrzewski\DoctrineDatabaseBackup;

use Doctrine\DBAL\Platforms\AbstractPlatform;
use Doctrine\ORM\EntityManager;
use Doctrine\ORM\Internal\CommitOrderCalculator;
use Doctrine\ORM\Mapping\ClassMetadata;
use Lucaszz\DoctrineDatabaseBackup\Storage\InMemoryStorage;
use Lzakrzewski\DoctrineDatabaseBackup\Storage\InMemoryStorage;

class Purger
{
Expand Down
4 changes: 2 additions & 2 deletions src/PurgerFactory.php
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
<?php

namespace Lucaszz\DoctrineDatabaseBackup;
namespace Lzakrzewski\DoctrineDatabaseBackup;

use Doctrine\ORM\EntityManager;
use Lucaszz\DoctrineDatabaseBackup\Storage\InMemoryStorage;
use Lzakrzewski\DoctrineDatabaseBackup\Storage\InMemoryStorage;

final class PurgerFactory
{
Expand Down
2 changes: 1 addition & 1 deletion src/Storage/InMemoryStorage.php
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<?php

namespace Lucaszz\DoctrineDatabaseBackup\Storage;
namespace Lzakrzewski\DoctrineDatabaseBackup\Storage;

class InMemoryStorage implements Storage
{
Expand Down
2 changes: 1 addition & 1 deletion src/Storage/LocalStorage.php
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<?php

namespace Lucaszz\DoctrineDatabaseBackup\Storage;
namespace Lzakrzewski\DoctrineDatabaseBackup\Storage;

class LocalStorage implements Storage
{
Expand Down
2 changes: 1 addition & 1 deletion src/Storage/Storage.php
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<?php

namespace Lucaszz\DoctrineDatabaseBackup\Storage;
namespace Lzakrzewski\DoctrineDatabaseBackup\Storage;

interface Storage
{
Expand Down
16 changes: 8 additions & 8 deletions tests/Backup/MySqlBackupTest.php
Original file line number Diff line number Diff line change
@@ -1,12 +1,12 @@
<?php

namespace Lucaszz\DoctrineDatabaseBackup\tests\Backup;
namespace Lzakrzewski\DoctrineDatabaseBackup\tests\Backup;

use Doctrine\DBAL\Connection;
use Lucaszz\DoctrineDatabaseBackup\Backup\MySqlBackup;
use Lucaszz\DoctrineDatabaseBackup\Purger;
use Lucaszz\DoctrineDatabaseBackup\Storage\InMemoryStorage;
use Lucaszz\DoctrineDatabaseBackup\tests\FakeLegacyCommand;
use Lzakrzewski\DoctrineDatabaseBackup\Backup\MySqlBackup;
use Lzakrzewski\DoctrineDatabaseBackup\Purger;
use Lzakrzewski\DoctrineDatabaseBackup\Storage\InMemoryStorage;
use Lzakrzewski\DoctrineDatabaseBackup\tests\FakeLegacyCommand;
use Prophecy\Prophecy\ObjectProphecy;

class MySqlBackupTest extends \PHPUnit_Framework_TestCase
Expand Down Expand Up @@ -95,9 +95,9 @@ public function it_fails_during_restoring_database_without_backup()
protected function setUp()
{
$this->connection = $this->prophesize('\Doctrine\DBAL\Connection');
$this->memoryStorage = $this->prophesize('\Lucaszz\DoctrineDatabaseBackup\Storage\InMemoryStorage');
$this->purger = $this->prophesize('\Lucaszz\DoctrineDatabaseBackup\Purger');
$this->command = $this->prophesize('\Lucaszz\DoctrineDatabaseBackup\Command\Command');
$this->memoryStorage = $this->prophesize('\Lzakrzewski\DoctrineDatabaseBackup\Storage\InMemoryStorage');
$this->purger = $this->prophesize('\Lzakrzewski\DoctrineDatabaseBackup\Purger');
$this->command = $this->prophesize('\Lzakrzewski\DoctrineDatabaseBackup\Command\Command');

$this->backup = new MySqlBackup($this->connection->reveal(), $this->memoryStorage->reveal(), $this->purger->reveal(), $this->command->reveal());
}
Expand Down
16 changes: 8 additions & 8 deletions tests/Backup/SqliteBackupTest.php
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
<?php

namespace Lucaszz\DoctrineDatabaseBackup\tests\Backup;
namespace Lzakrzewski\DoctrineDatabaseBackup\tests\Backup;

use Lucaszz\DoctrineDatabaseBackup\Backup\SqliteBackup;
use Lucaszz\DoctrineDatabaseBackup\Storage\InMemoryStorage;
use Lucaszz\DoctrineDatabaseBackup\Storage\LocalStorage;
use Lzakrzewski\DoctrineDatabaseBackup\Backup\SqliteBackup;
use Lzakrzewski\DoctrineDatabaseBackup\Storage\InMemoryStorage;
use Lzakrzewski\DoctrineDatabaseBackup\Storage\LocalStorage;
use Prophecy\Prophecy\ObjectProphecy;

class SqliteBackupTest extends \PHPUnit_Framework_TestCase
Expand Down Expand Up @@ -67,8 +67,8 @@ public function it_confirms_that_backup_was_not_created()
/** {@inheritdoc} */
protected function setUp()
{
$this->memoryStorage = $this->prophesize('Lucaszz\DoctrineDatabaseBackup\Storage\InMemoryStorage');
$this->localStorage = $this->prophesize('Lucaszz\DoctrineDatabaseBackup\Storage\LocalStorage');
$this->memoryStorage = $this->prophesize('Lzakrzewski\DoctrineDatabaseBackup\Storage\InMemoryStorage');
$this->localStorage = $this->prophesize('Lzakrzewski\DoctrineDatabaseBackup\Storage\LocalStorage');

$this->backup = new SqliteBackup(
'/var/www/project/database/sqlite.db',
Expand All @@ -80,8 +80,8 @@ protected function setUp()
/** {@inheritdoc} */
protected function tearDown()
{
$this->memoryStorage = $this->prophesize('Lucaszz\DoctrineDatabaseBackup\Storage\InMemoryStorage');
$this->localStorage = $this->prophesize('Lucaszz\DoctrineDatabaseBackup\Storage\LocalStorage');
$this->memoryStorage = $this->prophesize('Lzakrzewski\DoctrineDatabaseBackup\Storage\InMemoryStorage');
$this->localStorage = $this->prophesize('Lzakrzewski\DoctrineDatabaseBackup\Storage\LocalStorage');

$this->backup = null;
}
Expand Down
8 changes: 4 additions & 4 deletions tests/BackupFactoryTest.php
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
<?php

namespace Lucaszz\DoctrineDatabaseBackup\tests;
namespace Lzakrzewski\DoctrineDatabaseBackup\tests;

use Doctrine\DBAL\Connection;
use Doctrine\ORM\EntityManager;
use Lucaszz\DoctrineDatabaseBackup\BackupFactory;
use Lzakrzewski\DoctrineDatabaseBackup\BackupFactory;
use Prophecy\Prophecy\ObjectProphecy;

class BackupFactoryTest extends \PHPUnit_Framework_TestCase
Expand All @@ -21,7 +21,7 @@ public function it_can_create_instance_of_sqlite_backup()

$backup = BackupFactory::instance($this->entityManager->reveal());

$this->assertInstanceOf('\Lucaszz\DoctrineDatabaseBackup\Backup\SqliteBackup', $backup);
$this->assertInstanceOf('\Lzakrzewski\DoctrineDatabaseBackup\Backup\SqliteBackup', $backup);
}

/** @test */
Expand All @@ -31,7 +31,7 @@ public function it_can_create_instance_of_mysql_backup()

$backup = BackupFactory::instance($this->entityManager->reveal());

$this->assertInstanceOf('\Lucaszz\DoctrineDatabaseBackup\Backup\MySqlBackup', $backup);
$this->assertInstanceOf('\Lzakrzewski\DoctrineDatabaseBackup\Backup\MySqlBackup', $backup);
}

/**
Expand Down
2 changes: 1 addition & 1 deletion tests/Command/MysqldumpCommandTest.php
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<?php

namespace Lucaszz\DoctrineDatabaseBackup\tests\Command;
namespace Lzakrzewski\DoctrineDatabaseBackup\tests\Command;

class MysqldumpCommandTest extends \PHPUnit_Framework_TestCase
{
Expand Down
4 changes: 2 additions & 2 deletions tests/Command/MysqldumpDummyCommand.php
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
<?php

namespace Lucaszz\DoctrineDatabaseBackup\tests\Command;
namespace Lzakrzewski\DoctrineDatabaseBackup\tests\Command;

use Lucaszz\DoctrineDatabaseBackup\Command\MysqldumpCommand;
use Lzakrzewski\DoctrineDatabaseBackup\Command\MysqldumpCommand;

class MysqldumpDummyCommand extends MysqldumpCommand
{
Expand Down
14 changes: 7 additions & 7 deletions tests/Integration/AdvancedPHPUnitUsageExampleTest.php
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<?php

namespace Lucaszz\DoctrineDatabaseBackup\tests\Integration;
namespace Lzakrzewski\DoctrineDatabaseBackup\tests\Integration;

use Doctrine\Common\Annotations\AnnotationReader;
use Doctrine\Common\Annotations\AnnotationRegistry;
Expand All @@ -9,9 +9,9 @@
use Doctrine\ORM\Mapping\Driver\AnnotationDriver;
use Doctrine\ORM\Tools\SchemaTool;
use Doctrine\ORM\Tools\Setup;
use Lucaszz\DoctrineDatabaseBackup\DoctrineDatabaseBackup;
use Lucaszz\DoctrineDatabaseBackup\Storage\InMemoryStorage;
use Lucaszz\DoctrineDatabaseBackup\tests\Integration\Entity\Product\TestProduct;
use Lzakrzewski\DoctrineDatabaseBackup\DoctrineDatabaseBackup;
use Lzakrzewski\DoctrineDatabaseBackup\Storage\InMemoryStorage;
use Lzakrzewski\DoctrineDatabaseBackup\tests\Integration\Entity\Product\TestProduct;

class AdvancedPHPUnitUsageExampleTest extends \PHPUnit_Framework_TestCase
{
Expand All @@ -23,12 +23,12 @@ public function testThatItAddsProduct()
$this->entityManager->persist(new TestProduct('Teapot', 25));
$this->entityManager->flush();

$this->assertCount(2, $this->entityManager->getRepository('\Lucaszz\DoctrineDatabaseBackup\tests\Integration\Entity\Product\TestProduct')->findAll());
$this->assertCount(2, $this->entityManager->getRepository('\Lzakrzewski\DoctrineDatabaseBackup\tests\Integration\Entity\Product\TestProduct')->findAll());
}

public function testThatDatabaseContainsFixtures()
{
$this->assertCount(1, $this->entityManager->getRepository('\Lucaszz\DoctrineDatabaseBackup\tests\Integration\Entity\Product\TestProduct')->findAll());
$this->assertCount(1, $this->entityManager->getRepository('\Lzakrzewski\DoctrineDatabaseBackup\tests\Integration\Entity\Product\TestProduct')->findAll());
}

/**
Expand Down Expand Up @@ -98,7 +98,7 @@ private static function setupDatabase(EntityManager $entityManager)
$schemaTool = new SchemaTool($entityManager);
$schemaTool->dropDatabase();

$class = 'Lucaszz\DoctrineDatabaseBackup\tests\Integration\Entity\Product\TestProduct';
$class = 'Lzakrzewski\DoctrineDatabaseBackup\tests\Integration\Entity\Product\TestProduct';

$schemaTool->createSchema([$entityManager->getClassMetadata($class)]);
}
Expand Down
Loading

0 comments on commit 93a209c

Please sign in to comment.