Skip to content

Commit 907d763

Browse files
committed
Added assertion for exception message in test case 'testAssertTemplateNameFailsWhenNotFound()' and 'testAssertNotTemplateNameFailsWhenFound()'
Signed-off-by: Eric Richer [email protected] <[email protected]>
1 parent 450ce72 commit 907d763

File tree

1 file changed

+8
-0
lines changed

1 file changed

+8
-0
lines changed

test/PHPUnit/Controller/AbstractControllerTestCaseTest.php

+8
Original file line numberDiff line numberDiff line change
@@ -572,6 +572,10 @@ public function testAssertTemplateNameFailsWhenNotFound(): void
572572
try {
573573
$this->assertTemplateName('foo');
574574
} catch (ExpectationFailedException $exception) {
575+
$this->assertStringContainsString(
576+
'Failed asserting that view model tree contains template "foo"',
577+
$exception->getMessage()
578+
);
575579
return;
576580
}
577581
$this->fail('Expected Exception not thrown');
@@ -587,6 +591,10 @@ public function testAssertNotTemplateNameFailsWhenFound(): void
587591
try {
588592
$this->assertNotTemplateName('child1');
589593
} catch (ExpectationFailedException $exception) {
594+
$this->assertStringContainsString(
595+
'Failed asserting that view model tree does not contain template "child1"',
596+
$exception->getMessage()
597+
);
590598
return;
591599
}
592600
$this->fail('Expected Exception not thrown');

0 commit comments

Comments
 (0)