Skip to content

Commit

Permalink
Rename content resolver test
Browse files Browse the repository at this point in the history
  • Loading branch information
Prokyonn committed Sep 25, 2024
1 parent 34c9af1 commit d8116c8
Showing 1 changed file with 13 additions and 11 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -11,10 +11,12 @@
* with this source code in the file LICENSE.
*/

namespace Sulu\Bundle\ContentBundle\Tests\Unit\Content\Application\ContentResolver;
namespace Sulu\Bundle\ContentBundle\Tests\Unit\Content\Application\ContentAggregator;

use PHPUnit\Framework\TestCase;
use Prophecy\Argument;
use Prophecy\PhpUnit\ProphecyTrait;
use Sulu\Bundle\ContentBundle\Content\Application\ContentAggregator\ContentAggregator;
use Sulu\Bundle\ContentBundle\Content\Application\ContentAggregator\ContentAggregatorInterface;
use Sulu\Bundle\ContentBundle\Content\Application\ContentMerger\ContentMergerInterface;
use Sulu\Bundle\ContentBundle\Content\Domain\Exception\ContentNotFoundException;
Expand All @@ -24,21 +26,21 @@
use Sulu\Bundle\ContentBundle\Tests\Application\ExampleTestBundle\Entity\Example;
use Sulu\Bundle\ContentBundle\Tests\Application\ExampleTestBundle\Entity\ExampleDimensionContent;

class ContentResolverTest extends TestCase
class ContentAggregatorTest extends TestCase
{
use \Prophecy\PhpUnit\ProphecyTrait;
use ProphecyTrait;

protected function createContentResolverInstance(
protected function createContentAggregatorInstance(
DimensionContentRepositoryInterface $dimensionContentRepository,
ContentMergerInterface $contentMerger
): ContentAggregatorInterface {
return new \Sulu\Bundle\ContentBundle\Content\Application\ContentAggregator\ContentAggregator(
return new ContentAggregator(
$dimensionContentRepository,
$contentMerger
);
}

public function testResolve(): void
public function testAggregate(): void
{
$example = new Example();

Expand Down Expand Up @@ -79,15 +81,15 @@ public function testResolve(): void
->willReturn($mergedDimensionContent->reveal())
->shouldBeCalled();

$contentResolver = $this->createContentResolverInstance(
$contentAggregator = $this->createContentAggregatorInstance(
$dimensionContentRepository->reveal(),
$contentMerger->reveal()
);

$this->assertSame($mergedDimensionContent->reveal(), $contentResolver->aggregate($example, $attributes));
$this->assertSame($mergedDimensionContent->reveal(), $contentAggregator->aggregate($example, $attributes));
}

public function testResolveNotFound(): void
public function testAggregateNotFound(): void
{
$this->expectException(ContentNotFoundException::class);

Expand All @@ -114,11 +116,11 @@ public function testResolveNotFound(): void
$contentMerger = $this->prophesize(ContentMergerInterface::class);
$contentMerger->merge($dimensionContentCollection)->willReturn(Argument::cetera())->shouldNotBeCalled();

$contentResolver = $this->createContentResolverInstance(
$contentAggregator = $this->createContentAggregatorInstance(
$dimensionContentRepository->reveal(),
$contentMerger->reveal()
);

$contentResolver->aggregate($example, $attributes);
$contentAggregator->aggregate($example, $attributes);
}
}

0 comments on commit d8116c8

Please sign in to comment.