-
Notifications
You must be signed in to change notification settings - Fork 11
Expand file tree
/
Copy pathExceptionsTest.php
More file actions
56 lines (45 loc) · 1.78 KB
/
ExceptionsTest.php
File metadata and controls
56 lines (45 loc) · 1.78 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
<?php
declare(strict_types=1);
namespace Flowpack\NodeTemplates\Tests\Functional\Features\Exceptions;
use Flowpack\NodeTemplates\Tests\Functional\AbstractNodeTemplateTestCase;
use Flowpack\NodeTemplates\Tests\Functional\WithConfigurationTrait;
class ExceptionsTest extends AbstractNodeTemplateTestCase
{
use WithConfigurationTrait;
/** @test */
public function exceptionsAreCaughtAndPartialTemplateIsBuild(): void
{
$createdNode = $this->createNodeInto(
$this->homePageMainContentCollectionNode,
'Flowpack.NodeTemplates:Content.SomeExceptions',
[]
);
$this->assertLastCreatedTemplateMatchesSnapshot('SomeExceptions');
$this->assertCaughtExceptionsMatchesSnapshot('SomeExceptions');
$this->assertNodeDumpAndTemplateDumpMatchSnapshot('SomeExceptions', $createdNode);
}
/** @test */
public function exceptionsAreCaughtAndPartialTemplateIsNotBuild(): void
{
$this->withMockedConfigurationSettings([
'Flowpack' => [
'NodeTemplates' => [
'errorHandling' => [
'templateConfigurationProcessing' => [
'stopOnException' => true
]
]
]
]
], function () {
$createdNode = $this->createNodeInto(
$this->homePageMainContentCollectionNode,
'Flowpack.NodeTemplates:Content.OnlyExceptions',
[]
);
$this->assertLastCreatedTemplateMatchesSnapshot('OnlyExceptions');
$this->assertCaughtExceptionsMatchesSnapshot('OnlyExceptions');
$this->assertNodeDumpAndTemplateDumpMatchSnapshot('OnlyExceptions', $createdNode);
});
}
}