Skip to content

Commit 19a9d01

Browse files
authored
fixes BlockServiceTestCase (#1229)
1 parent 6e99cbf commit 19a9d01

File tree

1 file changed

+2
-15
lines changed

1 file changed

+2
-15
lines changed

docs/reference/testing.rst

Lines changed: 2 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -32,9 +32,9 @@ Given the following block service::
3232

3333
You can write unit tests for block services with the following code::
3434

35-
use Sonata\BlockBundle\Test\AbstractBlockServiceTestCase;
35+
use Sonata\BlockBundle\Test\BlockServiceTestCase;
3636

37-
class CustomBlockServiceTest extends AbstractBlockServiceTestCase
37+
class CustomBlockServiceTest extends BlockServiceTestCase
3838
{
3939
public function testDefaultSettings(): void
4040
{
@@ -47,17 +47,4 @@ You can write unit tests for block services with the following code::
4747
'template' => false,
4848
], $blockContext);
4949
}
50-
51-
public function testExecute(): void
52-
{
53-
$blockService = new CustomBlockService('foo', $this->twig);
54-
$blockContext = $this->getBlockContext($blockService);
55-
56-
$blockService->execute($blockContext);
57-
58-
$this->assertSame($blockContext, $this->templating->parameters['context']);
59-
$this->assertInternalType('array', $this->templating->parameters['settings']);
60-
$this->assertInstanceOf('Sonata\BlockBundle\Model\BlockInterface', $this->templating->parameters['block']);
61-
$this->assertSame('bar', $this->templating->parameters['foo']);
62-
}
6350
}

0 commit comments

Comments
 (0)