Skip to content

Commit

Permalink
IBX-8019: Fixed LocationEventSubscriberTest to actually check Notific…
Browse files Browse the repository at this point in the history
…ationService::sendNotification calls
  • Loading branch information
webhdx committed Jun 2, 2024
1 parent 12a5a1e commit 9b0ae0e
Show file tree
Hide file tree
Showing 3 changed files with 268 additions and 106 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -18,8 +18,6 @@

abstract class AbstractCoreEventSubscriberTest extends TestCase
{
/** @var \PHPUnit\Framework\MockObject\MockObject|\EzSystems\EzRecommendationClient\Service\EventNotificationService */
protected $notificationServiceMock;

/** @var \eZ\Publish\API\Repository\Values\Content\ContentInfo */
protected $contentInfo;
Expand All @@ -32,7 +30,6 @@ abstract class AbstractCoreEventSubscriberTest extends TestCase

public function setUp(): void
{
$this->notificationServiceMock = $this->createMock(EventNotificationService::class);
$this->contentInfo = new ContentInfo([
'id' => 1,
'contentTypeId' => 2,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,23 +10,35 @@

use eZ\Publish\API\Repository\ContentService;
use eZ\Publish\API\Repository\LocationService;
use eZ\Publish\API\Repository\SearchService;
use eZ\Publish\Core\Query\QueryFactoryInterface;
use EzSystems\EzRecommendationClient\Helper\ContentHelper;
use EzSystems\EzRecommendationClient\Helper\LocationHelper;
use EzSystems\EzRecommendationClient\Service\EventNotificationService;

abstract class AbstractRepositoryEventSubscriberTest extends AbstractCoreEventSubscriberTest
{
/** @var \PHPUnit\Framework\MockObject\MockObject|\eZ\Publish\API\Repository\ContentService */
/** @var \PHPUnit\Framework\MockObject\MockObject&\eZ\Publish\API\Repository\ContentService */
protected $contentServiceMock;

/** @var \PHPUnit\Framework\MockObject\MockObject|\eZ\Publish\API\Repository\LocationService */
/** @var \PHPUnit\Framework\MockObject\MockObject&\eZ\Publish\API\Repository\LocationService */
protected $locationServiceMock;

/** @var \PHPUnit\Framework\MockObject\MockObject|\EzSystems\EzRecommendationClient\Helper\LocationHelper */
/** @var \PHPUnit\Framework\MockObject\MockObject&\EzSystems\EzRecommendationClient\Helper\LocationHelper */
protected $locationHelperMock;

Check failure on line 28 in tests/lib/Event/Subscriber/AbstractRepositoryEventSubscriberTest.php

View workflow job for this annotation

GitHub Actions / Tests (8.1)

PHPDoc tag @var for property EzSystems\EzRecommendationClient\Tests\Event\Subscriber\AbstractRepositoryEventSubscriberTest::$locationHelperMock contains unresolvable type.

Check failure on line 28 in tests/lib/Event/Subscriber/AbstractRepositoryEventSubscriberTest.php

View workflow job for this annotation

GitHub Actions / Tests (8.0)

PHPDoc tag @var for property EzSystems\EzRecommendationClient\Tests\Event\Subscriber\AbstractRepositoryEventSubscriberTest::$locationHelperMock contains unresolvable type.

Check failure on line 28 in tests/lib/Event/Subscriber/AbstractRepositoryEventSubscriberTest.php

View workflow job for this annotation

GitHub Actions / Tests (7.4)

PHPDoc tag @var for property EzSystems\EzRecommendationClient\Tests\Event\Subscriber\AbstractRepositoryEventSubscriberTest::$locationHelperMock contains unresolvable type.

Check failure on line 28 in tests/lib/Event/Subscriber/AbstractRepositoryEventSubscriberTest.php

View workflow job for this annotation

GitHub Actions / Tests (7.3)

PHPDoc tag @var for property EzSystems\EzRecommendationClient\Tests\Event\Subscriber\AbstractRepositoryEventSubscriberTest::$locationHelperMock contains unresolvable type.

/** @var \PHPUnit\Framework\MockObject\MockObject|\EzSystems\EzRecommendationClient\Helper\ContentHelper */
/** @var \PHPUnit\Framework\MockObject\MockObject&\EzSystems\EzRecommendationClient\Helper\ContentHelper */
protected $contentHelperMock;

Check failure on line 31 in tests/lib/Event/Subscriber/AbstractRepositoryEventSubscriberTest.php

View workflow job for this annotation

GitHub Actions / Tests (8.1)

PHPDoc tag @var for property EzSystems\EzRecommendationClient\Tests\Event\Subscriber\AbstractRepositoryEventSubscriberTest::$contentHelperMock contains unresolvable type.

Check failure on line 31 in tests/lib/Event/Subscriber/AbstractRepositoryEventSubscriberTest.php

View workflow job for this annotation

GitHub Actions / Tests (8.0)

PHPDoc tag @var for property EzSystems\EzRecommendationClient\Tests\Event\Subscriber\AbstractRepositoryEventSubscriberTest::$contentHelperMock contains unresolvable type.

Check failure on line 31 in tests/lib/Event/Subscriber/AbstractRepositoryEventSubscriberTest.php

View workflow job for this annotation

GitHub Actions / Tests (7.4)

PHPDoc tag @var for property EzSystems\EzRecommendationClient\Tests\Event\Subscriber\AbstractRepositoryEventSubscriberTest::$contentHelperMock contains unresolvable type.

Check failure on line 31 in tests/lib/Event/Subscriber/AbstractRepositoryEventSubscriberTest.php

View workflow job for this annotation

GitHub Actions / Tests (7.3)

PHPDoc tag @var for property EzSystems\EzRecommendationClient\Tests\Event\Subscriber\AbstractRepositoryEventSubscriberTest::$contentHelperMock contains unresolvable type.

/** @var \PHPUnit\Framework\MockObject\MockObject&\eZ\Publish\Core\Query\QueryFactoryInterface */
protected $queryFactoryMock;

/** @var \PHPUnit\Framework\MockObject\MockObject&\eZ\Publish\API\Repository\SearchService */
protected $searchServiceMock;

/** @var \PHPUnit\Framework\MockObject\MockObject&\EzSystems\EzRecommendationClient\Service\EventNotificationService */
protected $notificationServiceMock;

Check failure on line 40 in tests/lib/Event/Subscriber/AbstractRepositoryEventSubscriberTest.php

View workflow job for this annotation

GitHub Actions / Tests (8.1)

PHPDoc tag @var for property EzSystems\EzRecommendationClient\Tests\Event\Subscriber\AbstractRepositoryEventSubscriberTest::$notificationServiceMock contains unresolvable type.

Check failure on line 40 in tests/lib/Event/Subscriber/AbstractRepositoryEventSubscriberTest.php

View workflow job for this annotation

GitHub Actions / Tests (8.0)

PHPDoc tag @var for property EzSystems\EzRecommendationClient\Tests\Event\Subscriber\AbstractRepositoryEventSubscriberTest::$notificationServiceMock contains unresolvable type.

Check failure on line 40 in tests/lib/Event/Subscriber/AbstractRepositoryEventSubscriberTest.php

View workflow job for this annotation

GitHub Actions / Tests (7.4)

PHPDoc tag @var for property EzSystems\EzRecommendationClient\Tests\Event\Subscriber\AbstractRepositoryEventSubscriberTest::$notificationServiceMock contains unresolvable type.

Check failure on line 40 in tests/lib/Event/Subscriber/AbstractRepositoryEventSubscriberTest.php

View workflow job for this annotation

GitHub Actions / Tests (7.3)

PHPDoc tag @var for property EzSystems\EzRecommendationClient\Tests\Event\Subscriber\AbstractRepositoryEventSubscriberTest::$notificationServiceMock contains unresolvable type.

public function setUp(): void
{
parent::setUp();
Expand All @@ -35,5 +47,8 @@ public function setUp(): void
$this->locationServiceMock = $this->createMock(LocationService::class);
$this->locationHelperMock = $this->createMock(LocationHelper::class);

Check failure on line 48 in tests/lib/Event/Subscriber/AbstractRepositoryEventSubscriberTest.php

View workflow job for this annotation

GitHub Actions / Tests (8.1)

Ignored error pattern #^Return type of call to method PHPUnit\\Framework\\TestCase\:\:createMock\(\) contains unresolvable type\.$# in path /home/runner/work/ezrecommendation-client/ezrecommendation-client/tests/lib/Event/Subscriber/AbstractRepositoryEventSubscriberTest.php is expected to occur 2 times, but occurred 3 times.

Check failure on line 48 in tests/lib/Event/Subscriber/AbstractRepositoryEventSubscriberTest.php

View workflow job for this annotation

GitHub Actions / Tests (8.0)

Ignored error pattern #^Return type of call to method PHPUnit\\Framework\\TestCase\:\:createMock\(\) contains unresolvable type\.$# in path /home/runner/work/ezrecommendation-client/ezrecommendation-client/tests/lib/Event/Subscriber/AbstractRepositoryEventSubscriberTest.php is expected to occur 2 times, but occurred 3 times.

Check failure on line 48 in tests/lib/Event/Subscriber/AbstractRepositoryEventSubscriberTest.php

View workflow job for this annotation

GitHub Actions / Tests (7.4)

Ignored error pattern #^Return type of call to method PHPUnit\\Framework\\TestCase\:\:createMock\(\) contains unresolvable type\.$# in path /home/runner/work/ezrecommendation-client/ezrecommendation-client/tests/lib/Event/Subscriber/AbstractRepositoryEventSubscriberTest.php is expected to occur 2 times, but occurred 3 times.

Check failure on line 48 in tests/lib/Event/Subscriber/AbstractRepositoryEventSubscriberTest.php

View workflow job for this annotation

GitHub Actions / Tests (7.3)

Ignored error pattern #^Return type of call to method PHPUnit\\Framework\\TestCase\:\:createMock\(\) contains unresolvable type\.$# in path /home/runner/work/ezrecommendation-client/ezrecommendation-client/tests/lib/Event/Subscriber/AbstractRepositoryEventSubscriberTest.php is expected to occur 2 times, but occurred 3 times.
$this->contentHelperMock = $this->createMock(ContentHelper::class);
$this->queryFactoryMock = $this->createMock(QueryFactoryInterface::class);
$this->searchServiceMock = $this->createMock(SearchService::class);
$this->notificationServiceMock = $this->createMock(EventNotificationService::class);

Check failure on line 52 in tests/lib/Event/Subscriber/AbstractRepositoryEventSubscriberTest.php

View workflow job for this annotation

GitHub Actions / Tests (8.1)

Return type of call to method PHPUnit\Framework\TestCase::createMock() contains unresolvable type.

Check failure on line 52 in tests/lib/Event/Subscriber/AbstractRepositoryEventSubscriberTest.php

View workflow job for this annotation

GitHub Actions / Tests (8.0)

Return type of call to method PHPUnit\Framework\TestCase::createMock() contains unresolvable type.

Check failure on line 52 in tests/lib/Event/Subscriber/AbstractRepositoryEventSubscriberTest.php

View workflow job for this annotation

GitHub Actions / Tests (7.4)

Return type of call to method PHPUnit\Framework\TestCase::createMock() contains unresolvable type.

Check failure on line 52 in tests/lib/Event/Subscriber/AbstractRepositoryEventSubscriberTest.php

View workflow job for this annotation

GitHub Actions / Tests (7.3)

Return type of call to method PHPUnit\Framework\TestCase::createMock() contains unresolvable type.
}
}
Loading

0 comments on commit 9b0ae0e

Please sign in to comment.