forked from getsentry/sentry-php
-
Notifications
You must be signed in to change notification settings - Fork 0
/
FrameTest.php
42 lines (34 loc) · 1.18 KB
/
FrameTest.php
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
<?php
declare(strict_types=1);
namespace Sentry\Tests;
use PHPUnit\Framework\TestCase;
use Sentry\Frame;
final class FrameTest extends TestCase
{
public function testConstructor(): void
{
$frame = new Frame('foo', 'bar', 10);
$this->assertEquals('foo', $frame->getFunctionName());
$this->assertEquals('bar', $frame->getFile());
$this->assertEquals(10, $frame->getLine());
}
/**
* @dataProvider gettersAndSettersDataProvider
*/
public function testGettersAndSetters(string $getterMethod, string $setterMethod, $expectedData): void
{
$frame = new Frame('foo', 'bar', 10);
$frame->$setterMethod($expectedData);
$this->assertEquals($expectedData, $frame->$getterMethod());
}
public static function gettersAndSettersDataProvider(): array
{
return [
['getPreContext', 'setPreContext', ['foo' => 'bar', 'bar' => 'baz']],
['getContextLine', 'setContextLine', 'foo bar'],
['getPostContext', 'setPostContext', ['bar' => 'foo', 'baz' => 'bar']],
['isInApp', 'setIsInApp', true],
['getVars', 'setVars', ['foo' => 'bar']],
];
}
}