Skip to content

Commit

Permalink
Remove Content prefix from ContentWorkflow transition subscribers
Browse files Browse the repository at this point in the history
  • Loading branch information
niklasnatter committed Feb 24, 2020
1 parent e2f15e5 commit dd557e3
Show file tree
Hide file tree
Showing 7 changed files with 18 additions and 18 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@
use Symfony\Component\EventDispatcher\EventSubscriberInterface;
use Symfony\Component\Workflow\Event\TransitionEvent;

class ContentPublishSubscriber implements EventSubscriberInterface
class PublishTransitionSubscriber implements EventSubscriberInterface
{
/**
* @var ContentCopierInterface
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@
use Symfony\Component\EventDispatcher\EventSubscriberInterface;
use Symfony\Component\Workflow\Event\TransitionEvent;

class ContentRemoveDraftSubscriber implements EventSubscriberInterface
class RemoveDraftTransitionSubscriber implements EventSubscriberInterface
{
/**
* @var ContentCopierInterface
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@
use Symfony\Component\EventDispatcher\EventSubscriberInterface;
use Symfony\Component\Workflow\Event\TransitionEvent;

class ContentUnpublishSubscriber implements EventSubscriberInterface
class UnpublishTransitionSubscriber implements EventSubscriberInterface
{
/**
* @var DimensionRepositoryInterface
Expand Down
6 changes: 3 additions & 3 deletions Resources/config/services.xml
Original file line number Diff line number Diff line change
Expand Up @@ -110,19 +110,19 @@

<service id="Sulu\Bundle\ContentBundle\Content\Application\ContentWorkflow\ContentWorkflowInterface" alias="sulu_content.content_workflow" />

<service id="sulu_content.content_publish_subscriber" class="Sulu\Bundle\ContentBundle\Content\Application\ContentWorkflow\Subscriber\ContentPublishSubscriber">
<service id="sulu_content.publish_transition_subscriber" class="Sulu\Bundle\ContentBundle\Content\Application\ContentWorkflow\Subscriber\PublishTransitionSubscriber">
<argument type="service" id="sulu_content.content_copier"/>

<tag name="kernel.event_subscriber"/>
</service>

<service id="sulu_content.content_remove_draft_subscriber" class="Sulu\Bundle\ContentBundle\Content\Application\ContentWorkflow\Subscriber\ContentRemoveDraftSubscriber">
<service id="sulu_content.remove_draft_transition_subscriber" class="Sulu\Bundle\ContentBundle\Content\Application\ContentWorkflow\Subscriber\RemoveDraftTransitionSubscriber">
<argument type="service" id="sulu_content.content_copier"/>

<tag name="kernel.event_subscriber"/>
</service>

<service id="sulu_content.content_unpublish_subscriber" class="Sulu\Bundle\ContentBundle\Content\Application\ContentWorkflow\Subscriber\ContentUnpublishSubscriber">
<service id="sulu_content.unpublish_transition_subscriber" class="Sulu\Bundle\ContentBundle\Content\Application\ContentWorkflow\Subscriber\UnpublishTransitionSubscriber">
<argument type="service" id="sulu.repository.dimension"/>
<argument type="service" id="sulu_content.dimension_content_repository"/>
<argument type="service" id="doctrine.orm.entity_manager"/>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@
use PHPUnit\Framework\TestCase;
use Prophecy\Argument;
use Sulu\Bundle\ContentBundle\Content\Application\ContentCopier\ContentCopierInterface;
use Sulu\Bundle\ContentBundle\Content\Application\ContentWorkflow\Subscriber\ContentPublishSubscriber;
use Sulu\Bundle\ContentBundle\Content\Application\ContentWorkflow\Subscriber\PublishTransitionSubscriber;
use Sulu\Bundle\ContentBundle\Content\Domain\Model\ContentProjectionInterface;
use Sulu\Bundle\ContentBundle\Content\Domain\Model\ContentRichEntityInterface;
use Sulu\Bundle\ContentBundle\Content\Domain\Model\DimensionContentCollectionInterface;
Expand All @@ -25,12 +25,12 @@
use Symfony\Component\Workflow\Event\TransitionEvent;
use Symfony\Component\Workflow\Marking;

class ContentPublishSubscriberTest extends TestCase
class PublishTransitionSubscriberTest extends TestCase
{
public function createContentPublisherSubscriberInstance(
ContentCopierInterface $contentCopier
): ContentPublishSubscriber {
return new ContentPublishSubscriber($contentCopier);
): PublishTransitionSubscriber {
return new PublishTransitionSubscriber($contentCopier);
}

public function testGetSubscribedEvents(): void
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,19 +16,19 @@
use PHPUnit\Framework\TestCase;
use Prophecy\Argument;
use Sulu\Bundle\ContentBundle\Content\Application\ContentCopier\ContentCopierInterface;
use Sulu\Bundle\ContentBundle\Content\Application\ContentWorkflow\Subscriber\ContentRemoveDraftSubscriber;
use Sulu\Bundle\ContentBundle\Content\Application\ContentWorkflow\Subscriber\RemoveDraftTransitionSubscriber;
use Sulu\Bundle\ContentBundle\Content\Domain\Model\ContentRichEntityInterface;
use Sulu\Bundle\ContentBundle\Content\Domain\Model\DimensionContentInterface;
use Sulu\Bundle\ContentBundle\Content\Domain\Model\WorkflowInterface;
use Symfony\Component\Workflow\Event\TransitionEvent;
use Symfony\Component\Workflow\Marking;

class ContentRemoveDraftSubscriberTest extends TestCase
class RemoveDraftTransitionSubscriberTest extends TestCase
{
public function createContentRemoveDraftSubscriberInstance(
ContentCopierInterface $contentCopier
): ContentRemoveDraftSubscriber {
return new ContentRemoveDraftSubscriber($contentCopier);
): RemoveDraftTransitionSubscriber {
return new RemoveDraftTransitionSubscriber($contentCopier);
}

public function testGetSubscribedEvents(): void
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@
use Doctrine\ORM\EntityManagerInterface;
use PHPUnit\Framework\TestCase;
use Prophecy\Argument;
use Sulu\Bundle\ContentBundle\Content\Application\ContentWorkflow\Subscriber\ContentUnpublishSubscriber;
use Sulu\Bundle\ContentBundle\Content\Application\ContentWorkflow\Subscriber\UnpublishTransitionSubscriber;
use Sulu\Bundle\ContentBundle\Content\Domain\Exception\ContentNotFoundException;
use Sulu\Bundle\ContentBundle\Content\Domain\Model\ContentRichEntityInterface;
use Sulu\Bundle\ContentBundle\Content\Domain\Model\DimensionCollectionInterface;
Expand All @@ -28,14 +28,14 @@
use Symfony\Component\Workflow\Event\TransitionEvent;
use Symfony\Component\Workflow\Marking;

class ContentUnpublishSubscriberTest extends TestCase
class UnpublishTransitionSubscriberTest extends TestCase
{
public function createContentUnpublishSubscriberInstance(
DimensionRepositoryInterface $dimensionRepository,
DimensionContentRepositoryInterface $dimensionContentRepository,
EntityManagerInterface $entityManager
): ContentUnpublishSubscriber {
return new ContentUnpublishSubscriber($dimensionRepository, $dimensionContentRepository, $entityManager);
): UnpublishTransitionSubscriber {
return new UnpublishTransitionSubscriber($dimensionRepository, $dimensionContentRepository, $entityManager);
}

public function testGetSubscribedEvents(): void
Expand Down

0 comments on commit dd557e3

Please sign in to comment.