Skip to content

Commit dbba660

Browse files
authored
Use the FlowTestCase in all the Adapters tests (#1306)
* Use the FlowTestCase in the Adapters tests * Fix import style * Fix ElasticSearch test cases * Fix import styling * Use the correct test case * Rename test cases to be more descriptive * Tests do not have to do anything about Elasticsearch * Fix import styling
1 parent ee70c57 commit dbba660

File tree

44 files changed

+90
-99
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

44 files changed

+90
-99
lines changed

src/adapter/etl-adapter-chartjs/tests/Flow/ETL/Adapter/ChartJS/Tests/Integration/ChartJSLoaderTest.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,9 +7,9 @@
77
use function Flow\ETL\Adapter\ChartJS\{bar_chart, line_chart, pie_chart, to_chartjs, to_chartjs_file, to_chartjs_var};
88
use function Flow\ETL\DSL\{df, first, from_array, lit, ref, refs, sum};
99
use function Flow\Filesystem\DSL\path;
10-
use PHPUnit\Framework\TestCase;
10+
use Flow\ETL\Tests\FlowTestCase;
1111

12-
final class ChartJSLoaderTest extends TestCase
12+
final class ChartJSLoaderTest extends FlowTestCase
1313
{
1414
public function test_loading_data_to_bar_chart() : void
1515
{

src/adapter/etl-adapter-chartjs/tests/Flow/ETL/Adapter/ChartJS/Tests/Unit/Chart/BarChartTest.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,9 +7,9 @@
77
use function Flow\ETL\DSL\{df, from_memory, ref, refs};
88
use Flow\ETL\Adapter\ChartJS\Chart\BarChart;
99
use Flow\ETL\Memory\ArrayMemory;
10-
use PHPUnit\Framework\TestCase;
10+
use Flow\ETL\Tests\FlowTestCase;
1111

12-
final class BarChartTest extends TestCase
12+
final class BarChartTest extends FlowTestCase
1313
{
1414
public function test_collecting_data_from_rows() : void
1515
{

src/adapter/etl-adapter-csv/tests/Flow/ETL/Adapter/CSV/Tests/Integration/CSVTest.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,9 +7,9 @@
77
use function Flow\ETL\Adapter\CSV\{from_csv, to_csv};
88
use function Flow\ETL\DSL\{df, overwrite, ref};
99
use Flow\ETL\Tests\Double\FakeExtractor;
10-
use PHPUnit\Framework\TestCase;
10+
use Flow\ETL\Tests\FlowTestCase;
1111

12-
final class CSVTest extends TestCase
12+
final class CSVTest extends FlowTestCase
1313
{
1414
protected function setUp() : void
1515
{

src/adapter/etl-adapter-csv/tests/Flow/ETL/Adapter/CSV/Tests/Unit/Detector/OptionTest.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,9 +6,9 @@
66

77
use Flow\ETL\Adapter\CSV\Detector\Option;
88
use Flow\ETL\Exception\InvalidArgumentException;
9-
use PHPUnit\Framework\TestCase;
9+
use Flow\ETL\Tests\FlowTestCase;
1010

11-
final class OptionTest extends TestCase
11+
final class OptionTest extends FlowTestCase
1212
{
1313
public function test_empty_enclosure() : void
1414
{

src/adapter/etl-adapter-doctrine/tests/Flow/ETL/Adapter/Doctrine/Tests/IntegrationTestCase.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -8,9 +8,9 @@
88
use Doctrine\DBAL\Tools\DsnParser;
99
use Doctrine\DBAL\{Configuration, DriverManager};
1010
use Flow\ETL\Adapter\Doctrine\Tests\Context\{DatabaseContext, InsertQueryCounter};
11-
use PHPUnit\Framework\TestCase;
11+
use Flow\ETL\Tests\FlowTestCase;
1212

13-
abstract class IntegrationTestCase extends TestCase
13+
abstract class IntegrationTestCase extends FlowTestCase
1414
{
1515
protected DatabaseContext $pgsqlDatabaseContext;
1616

src/adapter/etl-adapter-doctrine/tests/Flow/ETL/Adapter/Doctrine/Tests/Unit/PagesTest.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,9 +5,9 @@
55
namespace Flow\ETL\Adapter\Doctrine\Tests\Unit;
66

77
use Flow\ETL\Adapter\Doctrine\Pages;
8-
use PHPUnit\Framework\TestCase;
8+
use Flow\ETL\Tests\FlowTestCase;
99

10-
final class PagesTest extends TestCase
10+
final class PagesTest extends FlowTestCase
1111
{
1212
public function test_total_even_pages() : void
1313
{

src/adapter/etl-adapter-elasticsearch/tests/Flow/ETL/Adapter/Elasticsearch/Tests/Integration/ElasticsearchPHP/IntegrationTest.php renamed to src/adapter/etl-adapter-elasticsearch/tests/Flow/ETL/Adapter/Elasticsearch/Tests/Integration/ElasticsearchIntegrationTest.php

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2,15 +2,14 @@
22

33
declare(strict_types=1);
44

5-
namespace Flow\ETL\Adapter\Elasticsearch\Tests\Integration\ElasticsearchPHP;
5+
namespace Flow\ETL\Adapter\Elasticsearch\Tests\Integration;
66

77
use function Flow\ETL\Adapter\Elasticsearch\{es_hits_to_rows, from_es, to_es_bulk_index};
88
use function Flow\ETL\DSL\{bool_entry, int_entry, string_entry};
99
use Flow\ETL\Adapter\Elasticsearch\EntryIdFactory\EntryIdFactory;
10-
use Flow\ETL\Adapter\Elasticsearch\Tests\Integration\TestCase;
1110
use Flow\ETL\{Flow, Row, Rows};
1211

13-
final class IntegrationTest extends TestCase
12+
final class ElasticsearchIntegrationTest extends ElasticsearchTestCase
1413
{
1514
public const DESTINATION_INDEX = 'etl-test-destination-index';
1615

src/adapter/etl-adapter-elasticsearch/tests/Flow/ETL/Adapter/Elasticsearch/Tests/Integration/ElasticsearchPHP/ElasticsearchExtractorTest.php

Lines changed: 9 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -8,10 +8,15 @@
88
use function Flow\ETL\DSL\{bool_entry, df, generate_random_int, int_entry, string_entry};
99
use Flow\ETL\Adapter\Elasticsearch\ElasticsearchPHP\DocumentDataSource;
1010
use Flow\ETL\Adapter\Elasticsearch\EntryIdFactory\EntryIdFactory;
11-
use Flow\ETL\Adapter\Elasticsearch\Tests\Integration\TestCase;
12-
use Flow\ETL\{Config, Flow, FlowContext, Row, Rows};
13-
14-
final class ElasticsearchExtractorTest extends TestCase
11+
use Flow\ETL\{Adapter\Elasticsearch\Tests\Integration\ElasticsearchTestCase,
12+
Config,
13+
Flow,
14+
FlowContext,
15+
Row,
16+
Rows
17+
};
18+
19+
final class ElasticsearchExtractorTest extends ElasticsearchTestCase
1520
{
1621
public const INDEX_NAME = 'etl-test-index';
1722

src/adapter/etl-adapter-elasticsearch/tests/Flow/ETL/Adapter/Elasticsearch/Tests/Integration/ElasticsearchPHP/ElasticsearchLoaderTest.php

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -6,10 +6,9 @@
66

77
use function Flow\ETL\Adapter\Elasticsearch\{entry_id_factory, hash_id_factory, to_es_bulk_index, to_es_bulk_update};
88
use function Flow\ETL\DSL\{generate_random_string, string_entry};
9-
use Flow\ETL\Adapter\Elasticsearch\Tests\Integration\TestCase;
10-
use Flow\ETL\{Config, FlowContext, Row, Rows};
9+
use Flow\ETL\{Adapter\Elasticsearch\Tests\Integration\ElasticsearchTestCase, Config, FlowContext, Row, Rows};
1110

12-
final class ElasticsearchLoaderTest extends TestCase
11+
final class ElasticsearchLoaderTest extends ElasticsearchTestCase
1312
{
1413
public const INDEX_NAME = 'etl-test-index';
1514

src/adapter/etl-adapter-elasticsearch/tests/Flow/ETL/Adapter/Elasticsearch/Tests/Integration/ElasticsearchTest.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@
1010
use Flow\ETL\Adapter\Elasticsearch\Tests\Doubles\Spy\HttpClientSpy;
1111
use Flow\ETL\Flow;
1212

13-
final class ElasticsearchTest extends TestCase
13+
final class ElasticsearchTest extends ElasticsearchTestCase
1414
{
1515
public function test_batch_size_when_its_not_explicitly_set() : void
1616
{

0 commit comments

Comments
 (0)