Skip to content

Commit

Permalink
phpunit config cleanups
Browse files Browse the repository at this point in the history
dropping behat tests from PdoEventSourcing module and rewriting them using Ecotone Test Support
  • Loading branch information
unixslayer committed Jun 9, 2023
1 parent 930548e commit b5a6420
Show file tree
Hide file tree
Showing 64 changed files with 1,295 additions and 1,331 deletions.
3 changes: 2 additions & 1 deletion _PackageTemplate/.gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -5,4 +5,5 @@ tests/coverage
!tests/coverage/.gitkeep
file
.phpunit.result.cache
composer.lock
composer.lock
phpunit.xml
40 changes: 0 additions & 40 deletions _PackageTemplate/local_packages.json

This file was deleted.

35 changes: 0 additions & 35 deletions _PackageTemplate/phpunit.xml

This file was deleted.

20 changes: 20 additions & 0 deletions _PackageTemplate/phpunit.xml.dist
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
<?xml version="1.0" encoding="UTF-8"?>
<phpunit
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:noNamespaceSchemaLocation="https://schema.phpunit.de/9.3/phpunit.xsd"
backupGlobals="true"
>
<coverage processUncoveredFiles="true">
<include>
<directory suffix=".php">./src</directory>
</include>
<report>
<text outputFile="php://stdout" showOnlySummary="true" />
</report>
</coverage>
<testsuites>
<testsuite name="Unit Tests">
<directory>tests</directory>
</testsuite>
</testsuites>
</phpunit>
5 changes: 0 additions & 5 deletions behat.yml
Original file line number Diff line number Diff line change
Expand Up @@ -22,11 +22,6 @@ default:
- packages/Amqp/tests/Behat/features
contexts:
- Test\Ecotone\Amqp\Behat\Bootstrap\DomainContext
event-sourcing:
paths:
- packages/PdoEventSourcing/tests/Behat/features
contexts:
- Test\Ecotone\EventSourcing\Behat\Bootstrap\DomainContext
symfony:
extensions:
FriendsOfBehat\SymfonyExtension:
Expand Down
3 changes: 2 additions & 1 deletion packages/Amqp/.gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -5,4 +5,5 @@ tests/coverage
!tests/coverage/.gitkeep
file
.phpunit.result.cache
composer.lock
composer.lock
phpunit.xml
33 changes: 0 additions & 33 deletions packages/Amqp/phpunit.xml

This file was deleted.

20 changes: 20 additions & 0 deletions packages/Amqp/phpunit.xml.dist
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
<?xml version="1.0" encoding="UTF-8"?>
<phpunit
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:noNamespaceSchemaLocation="https://schema.phpunit.de/9.3/phpunit.xsd"
backupGlobals="true"
>
<coverage processUncoveredFiles="true">
<include>
<directory suffix=".php">./src</directory>
</include>
<report>
<text outputFile="php://stdout" showOnlySummary="true" />
</report>
</coverage>
<testsuites>
<testsuite name="Unit Tests">
<directory>tests</directory>
</testsuite>
</testsuites>
</phpunit>
3 changes: 2 additions & 1 deletion packages/Dbal/.gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -5,4 +5,5 @@ tests/coverage
!tests/coverage/.gitkeep
file
.phpunit.result.cache
composer.lock
composer.lock
phpunit.xml
33 changes: 0 additions & 33 deletions packages/Dbal/phpunit.xml

This file was deleted.

20 changes: 20 additions & 0 deletions packages/Dbal/phpunit.xml.dist
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
<?xml version="1.0" encoding="UTF-8"?>
<phpunit
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:noNamespaceSchemaLocation="https://schema.phpunit.de/9.3/phpunit.xsd"
backupGlobals="true"
>
<coverage processUncoveredFiles="true">
<include>
<directory suffix=".php">./src</directory>
</include>
<report>
<text outputFile="php://stdout" showOnlySummary="true" />
</report>
</coverage>
<testsuites>
<testsuite name="Unit Tests">
<directory>tests</directory>
</testsuite>
</testsuites>
</phpunit>
8 changes: 8 additions & 0 deletions packages/Ecotone/.gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
.idea/
vendor/
bin/
tests/coverage
!tests/coverage/.gitkeep
.phpunit.result.cache
composer.lock
phpunit.xml
33 changes: 0 additions & 33 deletions packages/Ecotone/phpunit.xml

This file was deleted.

20 changes: 20 additions & 0 deletions packages/Ecotone/phpunit.xml.dist
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
<?xml version="1.0" encoding="UTF-8"?>
<phpunit
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:noNamespaceSchemaLocation="https://schema.phpunit.de/9.3/phpunit.xsd"
backupGlobals="true"
>
<coverage processUncoveredFiles="true">
<include>
<directory suffix=".php">./src</directory>
</include>
<report>
<text outputFile="php://stdout" showOnlySummary="true" />
</report>
</coverage>
<testsuites>
<testsuite name="Unit Tests">
<directory>tests</directory>
</testsuite>
</testsuites>
</phpunit>
31 changes: 31 additions & 0 deletions packages/Ecotone/src/Lite/Test/FlowTestSupport.php
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@

namespace Ecotone\Lite\Test;

use Ecotone\EventSourcing\Config\EventSourcingModule;
use Ecotone\EventSourcing\EventStore;
use Ecotone\EventSourcing\ProjectionManager;
use Ecotone\Messaging\Config\ConfiguredMessagingSystem;
Expand Down Expand Up @@ -163,6 +164,36 @@ public function triggerProjection(string $projectionName): self
return $this;
}

public function initializeProjection(string $projectionName): self
{
$this->getGateway(ProjectionManager::class)->initializeProjection($projectionName);

return $this;
}

public function stopProjection(string $projectionName): self
{
$this->getGateway(ProjectionManager::class)->stopProjection($projectionName);

return $this;
}

public function resetProjection(string $projectionName): self
{
$this->getGateway(ProjectionManager::class)->resetProjection($projectionName);

return $this;
}

public function deleteProjection(string $projectionName): self
{
// fixme Calling ProjectionManager to delete the projection throws `Header with name ecotone.eventSourcing.manager.deleteEmittedEvents does not exists` exception
//$this->getGateway(ProjectionManager::class)->deleteProjection($projectionName);
$this->configuredMessagingSystem->runConsoleCommand('ecotone:es:delete-projection', ['name' => $projectionName]);

return $this;
}

/**
* @return mixed[]
*/
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@

use Ecotone\Messaging\Attribute\ServiceContext;

class CorrectClass
class CorrectMessagingClass
{
#[ServiceContext]
public function someExtension(): array
Expand Down
8 changes: 8 additions & 0 deletions packages/Enqueue/.gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
.idea/
vendor/
bin/
tests/coverage
!tests/coverage/.gitkeep
.phpunit.result.cache
composer.lock
phpunit.xml
Loading

0 comments on commit b5a6420

Please sign in to comment.