Skip to content

Commit

Permalink
Merge branch 'master' of github.com:sirdiego/importr
Browse files Browse the repository at this point in the history
  • Loading branch information
sirdiego committed Sep 9, 2016
2 parents c34026e + 6c52b96 commit e69a1e4
Show file tree
Hide file tree
Showing 14 changed files with 19 additions and 20 deletions.
2 changes: 1 addition & 1 deletion Classes/Feature/FeatureRegistry.php
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ class FeatureRegistry
{
/**
* @param string|array $names
* @param string $class
* @param string $class
*/
public static function enable($names, $class = Manager::class)
{
Expand Down
3 changes: 2 additions & 1 deletion Classes/Feature/RenameFile.php
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@ class RenameFile

/**
* RenameFile constructor.
*
* @param FileService $fileService
*/
public function __construct(FileService $fileService)
Expand Down Expand Up @@ -47,7 +48,7 @@ public static function enable()
* configuration if you are fully aware of it!
*
* @param ManagerInterface $manager
* @param Import $import
* @param Import $import
* @return void
*/
public function execute(ManagerInterface $manager, Import $import)
Expand Down
8 changes: 4 additions & 4 deletions Classes/Feature/TruncateTable.php
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,6 @@

use HDNET\Importr\Processor\Configuration;
use HDNET\Importr\Service\DatabaseService;
use HDNET\Importr\Service\ManagerInterface;

/**
* Class TruncateTable
Expand All @@ -20,6 +19,7 @@ class TruncateTable

/**
* TruncateTable constructor.
*
* @param DatabaseService $databaseService
*/
public function __construct(DatabaseService $databaseService)
Expand All @@ -43,10 +43,10 @@ public static function enable()
* an array, every element is used as a table
* name.
*
* @param ManagerInterface $manager
* @param array $configuration
* @param Configuration $processor
* @param array $configuration
*/
public function execute(ManagerInterface $manager, array $configuration)
public function execute(Configuration $processor, array $configuration)
{
if (isset($configuration['truncate'])) {
if (is_array($configuration['truncate'])) {
Expand Down
1 change: 1 addition & 0 deletions Classes/Processor/Configuration.php
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,7 @@ class Configuration

/**
* Configuration constructor.
*
* @param Dispatcher $signalSlotDispatcher
* @param StrategyRepository $strategyRepository
*/
Expand Down
1 change: 1 addition & 0 deletions Classes/Processor/Resource.php
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,7 @@ class Resource

/**
* Resource constructor.
*
* @param Configuration $configuration
* @param Target $target
* @param ImportServiceInterface $importService
Expand Down
1 change: 1 addition & 0 deletions Classes/Processor/Target.php
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@ class Target

/**
* Target constructor.
*
* @param ImportServiceInterface $importService
*/
public function __construct(ImportServiceInterface $importService)
Expand Down
1 change: 1 addition & 0 deletions Classes/Service/ImportService.php
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,7 @@ class ImportService implements ImportServiceInterface

/**
* ImportService constructor.
*
* @param PersistenceManagerInterface $persistenceManager
* @param ObjectManagerInterface $objectManager
* @param ImportRepository $importRepository
Expand Down
1 change: 0 additions & 1 deletion Classes/Service/Resources/Csv.php
Original file line number Diff line number Diff line change
Expand Up @@ -128,6 +128,5 @@ public function getEntry($pointer)
*/
public function end()
{

}
}
2 changes: 0 additions & 2 deletions Classes/Service/Resources/Dummy.php
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,6 @@ protected function getRandomContent()
*/
public function start(Strategy $strategy, $filepath)
{

}

/**
Expand Down Expand Up @@ -114,6 +113,5 @@ public function getEntry($pointer)
*/
public function end()
{

}
}
1 change: 0 additions & 1 deletion Classes/Service/Resources/Excel.php
Original file line number Diff line number Diff line change
Expand Up @@ -119,6 +119,5 @@ public function getEntry($pointer)
*/
public function end()
{

}
}
2 changes: 0 additions & 2 deletions Classes/Service/Targets/DbRecord.php
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,6 @@ class DbRecord extends AbstractTarget implements TargetInterface
*/
public function start(Strategy $strategy)
{

}

/**
Expand Down Expand Up @@ -58,6 +57,5 @@ public function processEntry(array $entry)
*/
public function end()
{

}
}
1 change: 1 addition & 0 deletions Classes/Service/Targets/ExtbaseModel.php
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,7 @@ class ExtbaseModel extends AbstractTarget implements TargetInterface

/**
* ExtbaseModel constructor.
*
* @param \TYPO3\CMS\Extbase\Persistence\PersistenceManagerInterface $persistenceManager
* @param \TYPO3\CMS\Extbase\Object\ObjectManagerInterface $objectManager
*/
Expand Down
13 changes: 6 additions & 7 deletions Tests/Unit/Feature/TruncateTableTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,6 @@
use HDNET\Importr\Feature\TruncateTable;
use HDNET\Importr\Processor\Configuration;
use HDNET\Importr\Service\DatabaseService;
use HDNET\Importr\Service\ManagerInterface;
use TYPO3\CMS\Core\Database\DatabaseConnection;
use TYPO3\CMS\Core\Tests\UnitTestCase;
use TYPO3\CMS\Core\Utility\GeneralUtility;
Expand Down Expand Up @@ -43,22 +42,22 @@ public function setUp()
*/
public function do_not_truncate_when_not_configured()
{
$manager = $this->getMock(ManagerInterface::class);
$processor = $this->getMockBuilder(Configuration::class)->disableOriginalConstructor()->getMock();
$this->connection->expects($this->never())->method('exec_TRUNCATEquery');

$this->fixture->execute($manager, []);
$this->fixture->execute($processor, []);
}

/**
* @test
*/
public function truncate_when_configured()
{
$manager = $this->getMock(ManagerInterface::class);
$processor = $this->getMockBuilder(Configuration::class)->disableOriginalConstructor()->getMock();

$this->connection->expects($this->once())->method('exec_TRUNCATEquery');

$this->fixture->execute($manager, ['truncate' => true]);
$this->fixture->execute($processor, ['truncate' => true]);
}

/**
Expand All @@ -74,10 +73,10 @@ public function truncate_multiple_tables_when_configured()
]
];

$manager = $this->getMock(ManagerInterface::class);
$processor = $this->getMockBuilder(Configuration::class)->disableOriginalConstructor()->getMock();
$this->connection->expects($this->exactly(3))->method('exec_TRUNCATEquery')->withConsecutive(['test'], ['test2'], ['test3']);

$this->fixture->execute($manager, $configuration);
$this->fixture->execute($processor, $configuration);
}

/**
Expand Down
2 changes: 1 addition & 1 deletion composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@
"issues": "https://github.com/sirdiego/importr/issues"
},
"require-dev": {
"namelesscoder/typo3-repository-client": "1.1.x-dev",
"namelesscoder/typo3-repository-client": "^1.1",
"phpunit/phpunit": "~4.8.0",
"squizlabs/php_codesniffer": "^2.6",
"phpmd/phpmd": "^2.4",
Expand Down

0 comments on commit e69a1e4

Please sign in to comment.