Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
We use your nice little package in our project. We added it to our Dependency Injection container as a service. Unfortunately the class `Query` is final. Therefore we can't create mocks for it and therefore can't unit test classes that depend on this service. Example: ``` <?php namespace Pickware\PickwareErpStarter\ImportExport\Csv; use Franzose\DoctrineBulkInsert\Query; use PHPUnit\Framework\TestCase; class CsvToDatabaseReaderTest extends TestCase { /** * @before */ public function setUpTest() { $this->bulkInserterMock = $this->createMock(Query::class); $this->csvToDatabaseReader = new CsvToDatabaseReader($this->bulkInserterMock); } public function test_readChunk() { $this->csvToDatabaseReader->readChunk(); } } ``` Leads to: ``` Class "Franzose\DoctrineBulkInsert\Query" is declared "final" and cannot be mocked. .../vendor/phpunit/phpunit/src/TextUI/Command.php:204 .../vendor/phpunit/phpunit/src/TextUI/Command.php:163 ``` Also I think there is no reason, this should be final.
- Loading branch information