Skip to content

Commit

Permalink
Merge 389e416 into 9e761e4
Browse files Browse the repository at this point in the history
  • Loading branch information
phansys committed Aug 27, 2020
2 parents 9e761e4 + 389e416 commit d0cc861
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 4 deletions.
4 changes: 2 additions & 2 deletions tests/Block/AuditBlockServiceTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@
use PHPUnit\Framework\MockObject\MockObject;
use SimpleThings\EntityAudit\AuditReader as SimpleThingsAuditReader;
use SimpleThings\EntityAudit\Revision;
use Sonata\BlockBundle\Block\BlockContext;
use Sonata\BlockBundle\Block\BlockContextInterface;
use Sonata\BlockBundle\Model\Block;
use Sonata\BlockBundle\Test\BlockServiceTestCase;
use Sonata\DoctrineORMAdminBundle\Block\AuditBlockService;
Expand Down Expand Up @@ -52,7 +52,7 @@ protected function setUp(): void
*/
public function testExecute(): void
{
$blockContext = $this->createMock(BlockContext::class);
$blockContext = $this->createMock(BlockContextInterface::class);

$blockContext->expects($this->once())->method('getBlock')->willReturn($block = new Block());
$blockContext->expects($this->once())->method('getSetting')->with('limit')->willReturn($limit = 10);
Expand Down
11 changes: 9 additions & 2 deletions tests/Block/DeprecatedAuditBlockServiceTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@
use Prophecy\Argument;
use SimpleThings\EntityAudit\AuditReader as SimpleThingsAuditReader;
use SimpleThings\EntityAudit\Revision;
use Sonata\BlockBundle\Block\BlockContext;
use Sonata\BlockBundle\Block\BlockContextInterface;
use Sonata\BlockBundle\Model\Block;
use Sonata\BlockBundle\Test\BlockServiceTestCase;
use Sonata\DoctrineORMAdminBundle\Block\AuditBlockService;
Expand All @@ -35,6 +35,13 @@ class DeprecatedAuditBlockServiceTest extends BlockServiceTestCase

protected function setUp(): void
{
if (!property_exists($this, 'templating')) {
$this->markTestSkipped(sprintf(
'%s requires sonata-project/block-bundle < 3.18.4.',
__CLASS__
));
}

parent::setUp();
$this->simpleThingsAuditReader = $this->prophesize(SimpleThingsAuditReader::class);

Expand All @@ -50,7 +57,7 @@ protected function setUp(): void
*/
public function testExecute(): void
{
$blockContext = $this->prophesize(BlockContext::class);
$blockContext = $this->prophesize(BlockContextInterface::class);

$blockContext->getBlock()->willReturn($block = new Block())->shouldBeCalledTimes(1);
$blockContext->getSetting('limit')->willReturn($limit = 10)->shouldBeCalledTimes(1);
Expand Down

0 comments on commit d0cc861

Please sign in to comment.