-
Notifications
You must be signed in to change notification settings - Fork 53
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
f8121fc
commit f9dc205
Showing
4 changed files
with
78 additions
and
3 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,43 @@ | ||
services: # default configuration for services in *this* file | ||
_defaults: | ||
# automatically injects dependencies in your services | ||
autowire: true | ||
# automatically registers your services as commands, event subscribers, etc. | ||
autoconfigure: false | ||
# false means you cannot fetch services directly from the container via $container->get() | ||
# if you need to do this, you can override this setting on individual services | ||
public: false | ||
bind: | ||
$eventStore: '@Galeas\Api\Service\EventStore\SQLEventStore' | ||
$reactionDocumentManager: '@doctrine_mongodb.odm.reaction_document_manager' | ||
$projectionDocumentManager: '@doctrine_mongodb.odm.projection_document_manager' | ||
Galeas\Api\Service\EventStore\SQLEventStoreConnection: | ||
public: true | ||
class: Galeas\Api\Service\EventStore\SQLEventStoreConnection | ||
arguments: | ||
- '%event_store_database_name%' | ||
- '%event_store_database_host%' | ||
- '%event_store_database_port%' | ||
- '%event_store_database_user%' | ||
- '%event_store_database_password%' | ||
Galeas\Api\Service\ODM\DocumentManagerForTests: | ||
public: true | ||
class: Galeas\Api\Service\ODM\DocumentManagerForTests | ||
galeas.bounded_context_services: | ||
public: true | ||
namespace: Galeas\Api\BoundedContext\ | ||
resource: '../src/BoundedContext/' | ||
_instanceof: | ||
Galeas\Api\Common\Controller\BaseController: | ||
calls: | ||
- setJsonPostRequestMapper: [ '@Galeas\Api\Service\RequestMapper\JsonPostRequestMapper' ] | ||
- setJsonSchemaFetcher: [ '@Galeas\Api\JsonSchema\JsonSchemaFetcher' ] | ||
- setJsonSchemaValidator: [ '@Galeas\Api\JsonSchema\JsonSchemaValidator' ] | ||
- setPhpOutLogger: [ '@Galeas\Api\Service\Logger\PhpOutLogger' ] | ||
Symfony\Bundle\FrameworkBundle\Controller\AbstractController: | ||
# Handlers and their dependencies will only be testable if they're in the test container. | ||
# For this to be true at least one public service has to use them. Controllers will do the job. | ||
public: true | ||
tags: [ 'controller.service_arguments' ] | ||
calls: | ||
- [ 'setContainer', [ '@service_container' ] ] |
28 changes: 28 additions & 0 deletions
28
application/monolith/code/src/Service/ODM/DocumentManagerForTests.php
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,28 @@ | ||
<?php | ||
|
||
declare(strict_types=1); | ||
|
||
namespace Galeas\Api\Service\ODM; | ||
|
||
|
||
use Doctrine\ODM\MongoDB\DocumentManager; | ||
|
||
class DocumentManagerForTests { | ||
private DocumentManager $projectionDocumentManager; | ||
private DocumentManager $reactionDocumentManager; | ||
public function __construct($projectionDocumentManager, $reactionDocumentManager) | ||
{ | ||
$this->projectionDocumentManager = $projectionDocumentManager; | ||
$this->reactionDocumentManager = $reactionDocumentManager; | ||
} | ||
|
||
public function projectionDocumentManager(): DocumentManager | ||
{ | ||
return $this->projectionDocumentManager; | ||
} | ||
|
||
public function reactionDocumentManager(): DocumentManager | ||
{ | ||
return $this->reactionDocumentManager; | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters