Skip to content

Commit

Permalink
rename class
Browse files Browse the repository at this point in the history
  • Loading branch information
Michail Rybakov committed Feb 19, 2015
1 parent 46ae4d7 commit 9d01151
Show file tree
Hide file tree
Showing 10 changed files with 47 additions and 19 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@
/**
* Base function test class.
*/
abstract class TestBase extends WebTestCase
abstract class AbstractTestCase extends WebTestCase
{
/**
* @var string
Expand Down Expand Up @@ -236,4 +236,32 @@ protected static function getRootDir($container)
{
return $container->get('kernel')->getRootDir();
}

/**
* Return an array of elements required for testing.
*
* @param array $ids
* @param string $repository
*
* @return Object[]
*/
protected function getTestElements(array $ids, $repository)
{
$items = [];
$entityManager = $this->getEntityManager();
$rep = $entityManager->getRepository($repository);
foreach ($ids as $id) {
if (is_array($id)) {
$element = $rep->findBy($id);
} else {
$element = $rep->find($id);
}

if ($element !== null) {
$items[] = $element;
}
}

return $items;
}
}
4 changes: 2 additions & 2 deletions Tests/Functional/Command/SyncProvideCommandTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@
use ONGR\ConnectionsBundle\Command\SyncProvideCommand;
use ONGR\ConnectionsBundle\Sync\ActionTypes;
use ONGR\ConnectionsBundle\Sync\StorageManager\MysqlStorageManager;
use ONGR\ConnectionsBundle\Tests\Functional\TestBase;
use ONGR\ConnectionsBundle\Tests\Functional\AbstractTestCase;
use Symfony\Bundle\FrameworkBundle\Console\Application;
use Symfony\Component\Console\Tester\CommandTester;
use Symfony\Component\HttpKernel\KernelInterface;
Expand All @@ -23,7 +23,7 @@
use ONGR\ConnectionsBundle\Sync\DiffProvider\Binlog\BinlogDiffProvider;
use ONGR\ConnectionsBundle\Sync\DiffProvider\Binlog\BinlogParser;

class SyncProvideCommandTest extends TestBase
class SyncProvideCommandTest extends AbstractTestCase
{
/**
* @var MysqlStorageManager
Expand Down
4 changes: 2 additions & 2 deletions Tests/Functional/Command/SyncStorageCreateCommandTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -14,14 +14,14 @@
use Doctrine\DBAL\Schema\Table;
use ONGR\ConnectionsBundle\Command\SyncStorageCreateCommand;
use ONGR\ConnectionsBundle\Sync\SyncStorage\SyncStorage;
use ONGR\ConnectionsBundle\Tests\Functional\TestBase;
use ONGR\ConnectionsBundle\Tests\Functional\AbstractTestCase;
use Symfony\Bundle\FrameworkBundle\Console\Application;
use Symfony\Component\Console\Tester\CommandTester;

/**
* Integration test for ongr:sync:storage:create command.
*/
class SyncStorageCreateCommandTest extends TestBase
class SyncStorageCreateCommandTest extends AbstractTestCase
{
/**
* @var \Symfony\Component\Console\Command\Command
Expand Down
4 changes: 2 additions & 2 deletions Tests/Functional/Command/UrlInvalidatorServiceTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -13,12 +13,12 @@

use ONGR\ConnectionsBundle\Service\UrlInvalidatorService;
use ONGR\ConnectionsBundle\Tests\Model\ProductModel;
use ONGR\ConnectionsBundle\Tests\Functional\TestBase;
use ONGR\ConnectionsBundle\Tests\Functional\AbstractTestCase;

/**
* Functional test for url invalidator service.
*/
class UrlInvalidatorServiceTest extends TestBase
class UrlInvalidatorServiceTest extends AbstractTestCase
{
/**
* @return array
Expand Down
4 changes: 2 additions & 2 deletions Tests/Functional/Sync/Binlog/BinlogParserTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -13,13 +13,13 @@

use ONGR\ConnectionsBundle\Sync\ActionTypes;
use ONGR\ConnectionsBundle\Sync\DiffProvider\Binlog\BinlogParser;
use ONGR\ConnectionsBundle\Tests\Functional\TestBase;
use ONGR\ConnectionsBundle\Tests\Functional\AbstractTestCase;
use PHPUnit_Framework_MockObject_MockObject as MockObject;

/**
* Functional test for binary log parser.
*/
class BinlogParserTest extends TestBase
class BinlogParserTest extends AbstractTestCase
{
/**
* Clear logs before each test.
Expand Down
4 changes: 2 additions & 2 deletions Tests/Functional/Sync/Extractor/DoctrineExtractorTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -15,9 +15,9 @@
use ONGR\ConnectionsBundle\Sync\DiffProvider\Item\CreateDiffItem;
use ONGR\ConnectionsBundle\Sync\DiffProvider\Item\UpdateDiffItem;
use ONGR\ConnectionsBundle\Sync\SyncStorage\SyncStorageInterface;
use ONGR\ConnectionsBundle\Tests\Functional\TestBase;
use ONGR\ConnectionsBundle\Tests\Functional\AbstractTestCase;

class DoctrineExtractorTest extends TestBase
class DoctrineExtractorTest extends AbstractTestCase
{
/**
* Test extraction service to insert updates to SyncStorage.
Expand Down
4 changes: 2 additions & 2 deletions Tests/Functional/Sync/Extractor/PassthroughExtractorTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -19,9 +19,9 @@
use ONGR\ConnectionsBundle\Sync\Extractor\PassthroughExtractor;
use ONGR\ConnectionsBundle\Sync\StorageManager\MysqlStorageManager;
use ONGR\ConnectionsBundle\Sync\SyncStorage\SyncStorage;
use ONGR\ConnectionsBundle\Tests\Functional\TestBase;
use ONGR\ConnectionsBundle\Tests\Functional\AbstractTestCase;

class PassthroughExtractorTest extends TestBase
class PassthroughExtractorTest extends AbstractTestCase
{
const TABLE_NAME = 'data_sync_test_storage';

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,9 +14,9 @@
use DateTime;
use ONGR\ConnectionsBundle\Sync\ActionTypes;
use ONGR\ConnectionsBundle\Sync\StorageManager\MysqlStorageManager;
use ONGR\ConnectionsBundle\Tests\Functional\TestBase;
use ONGR\ConnectionsBundle\Tests\Functional\AbstractTestCase;

class MysqlStorageManagerTest extends TestBase
class MysqlStorageManagerTest extends AbstractTestCase
{
const TABLE_NAME = 'sync_storage_test_storage';

Expand Down
4 changes: 2 additions & 2 deletions Tests/Functional/Sync/SyncStorage/SyncStorageTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -15,13 +15,13 @@
use ONGR\ConnectionsBundle\Sync\ActionTypes;
use ONGR\ConnectionsBundle\Sync\StorageManager\StorageManagerInterface;
use ONGR\ConnectionsBundle\Sync\SyncStorage\SyncStorage;
use ONGR\ConnectionsBundle\Tests\Functional\TestBase;
use ONGR\ConnectionsBundle\Tests\Functional\AbstractTestCase;
use PHPUnit_Framework_MockObject_MockObject as MockObject;

/**
* Functional test for SyncStorage.
*/
class SyncStorageTest extends TestBase
class SyncStorageTest extends AbstractTestCase
{
/**
* @var StorageManagerInterface|MockObject
Expand Down
4 changes: 2 additions & 2 deletions Tests/Functional/Sync/TableManagerTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -13,12 +13,12 @@

use Doctrine\DBAL\Schema\Table;
use ONGR\ConnectionsBundle\Sync\DiffProvider\SyncJobs\TableManager;
use ONGR\ConnectionsBundle\Tests\Functional\TestBase;
use ONGR\ConnectionsBundle\Tests\Functional\AbstractTestCase;

/**
* Functional test for TableManager.
*/
class TableManagerTest extends TestBase
class TableManagerTest extends AbstractTestCase
{
/**
* Data provider for testDoCleanup().
Expand Down

0 comments on commit 9d01151

Please sign in to comment.