Skip to content

Commit cda6520

Browse files
committed
BitrixExceptionAssertTrait. Ассерт на битриксовое исключение (по тексту).
1 parent df716cc commit cda6520

File tree

1 file changed

+29
-0
lines changed

1 file changed

+29
-0
lines changed
Lines changed: 29 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,29 @@
1+
<?php
2+
3+
namespace Prokl\BitrixTestingTools\Traits;
4+
5+
/**
6+
* Trait BitrixExceptionAssertTrait
7+
* @package Prokl\BitrixTestingTools\Traits
8+
*
9+
* @since 26.04.2021
10+
*/
11+
trait BitrixExceptionAssertTrait
12+
{
13+
/**
14+
* Ассерт на битриксовое исключение (по тексту).
15+
*
16+
* @param string $message Сообщение в битриксовом исключении.
17+
*
18+
* @return void
19+
*/
20+
protected function willExpectBitrixExceptionMessage(string $message) : void
21+
{
22+
$exceptionText = $GLOBALS['APPLICATION']->GetException();
23+
24+
$this->assertSame(
25+
$message,
26+
$exceptionText->GetString()
27+
);
28+
}
29+
}

0 commit comments

Comments
 (0)