Skip to content

Commit

Permalink
Fix code style in Events package
Browse files Browse the repository at this point in the history
  • Loading branch information
MantasVaitkunas committed Dec 5, 2018
1 parent 021b74d commit 8e3548b
Show file tree
Hide file tree
Showing 6 changed files with 13 additions and 31 deletions.
Original file line number Diff line number Diff line change
@@ -1,6 +1,4 @@
<?php
declare(strict_types=1);

<?php declare(strict_types=1);
/**
* Copyright © OXID eSales AG. All rights reserved.
* See LICENSE file for license details.
Expand Down
4 changes: 1 addition & 3 deletions source/Internal/Application/Events/ShopAwareInterface.php
Original file line number Diff line number Diff line change
@@ -1,6 +1,4 @@
<?php
declare(strict_types=1);

<?php declare(strict_types=1);
/**
* Copyright © OXID eSales AG. All rights reserved.
* See LICENSE file for license details.
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
<?php declare(strict_types=1);

/**
* Copyright © OXID eSales AG. All rights reserved.
* See LICENSE file for license details.
Expand Down
Original file line number Diff line number Diff line change
@@ -1,14 +1,11 @@
<?php
declare(strict_types=1);

<?php declare(strict_types=1);
/**
* Copyright © OXID eSales AG. All rights reserved.
* See LICENSE file for license details.
*/

namespace OxidEsales\EshopCommunity\Tests\Integration\Internal\Application\Events;


use OxidEsales\EshopCommunity\Internal\Application\ContainerBuilder;
use OxidEsales\EshopCommunity\Internal\Utility\ContextInterface;
use OxidEsales\EshopCommunity\Tests\Unit\Internal\ContextStub;
Expand All @@ -27,7 +24,6 @@ class ShopAwareEventsTest extends \PHPUnit\Framework\TestCase
*/
private $dispatcher;


public function setUp()
{

Expand All @@ -53,23 +49,22 @@ public function setUp()
* but propagation is stopped after the second handler, so
* we should have 2 active event handlers
*/
public function testShopActivatedEvent() {

public function testShopActivatedEvent()
{
/**
* @var $event TestEvent
*/
$event = $this->dispatcher->dispatch('oxidesales.testevent', new TestEvent());
$this->assertEquals(2, $event->getNumberOfActiveHandlers());

}

/**
* Only the second and third subscriber are active for shop 2, current shop is 2
* but propagation is stopped after the second handler, so
* we should have 1 active event handler
*/
public function testShopNotActivatedEvent() {

public function testShopNotActivatedEvent()
{
/**
* @var ContextStub $contextStub
*/
Expand All @@ -80,6 +75,5 @@ public function testShopNotActivatedEvent() {
*/
$event = $this->dispatcher->dispatch('oxidesales.testevent', new TestEvent());
$this->assertEquals(1, $event->getNumberOfActiveHandlers());

}
}
8 changes: 2 additions & 6 deletions tests/Integration/Internal/Application/Events/TestEvent.php
Original file line number Diff line number Diff line change
@@ -1,14 +1,11 @@
<?php
declare(strict_types=1);

<?php declare(strict_types=1);
/**
* Copyright © OXID eSales AG. All rights reserved.
* See LICENSE file for license details.
*/

namespace OxidEsales\EshopCommunity\Tests\Integration\Internal\Application\Events;


use Symfony\Component\EventDispatcher\Event;

class TestEvent extends Event
Expand All @@ -24,5 +21,4 @@ public function handleEvent()
{
$this->counter++;
}

}
}
Original file line number Diff line number Diff line change
@@ -1,6 +1,4 @@
<?php
declare(strict_types=1);

<?php declare(strict_types=1);
/**
* Copyright © OXID eSales AG. All rights reserved.
* See LICENSE file for license details.
Expand All @@ -9,11 +7,10 @@
namespace OxidEsales\EshopCommunity\Tests\Integration\Internal\Application\Events;


use OxidEsales\EshopCommunity\Internal\Application\Events\AbstractShopAwareEventSubscriber;
use OxidEsales\EshopCommunity\Internal\Application\Events\ShopAwareEventSubscriber;

class TestEventSubscriber extends AbstractShopAwareEventSubscriber
class TestEventSubscriber extends ShopAwareEventSubscriber
{

private $stopPropagation = false;

public function __construct($stopPropagation)
Expand Down Expand Up @@ -54,4 +51,4 @@ public static function getSubscribedEvents()
{
return ['oxidesales.testevent' => 'handleEvent'];
}
}
}

0 comments on commit 8e3548b

Please sign in to comment.