|
1 | 1 | <?php |
2 | 2 |
|
3 | 3 | use FiveamCode\LaravelNotionApi\Entities\NotionParent; |
4 | | -use FiveamCode\LaravelNotionApi\Exceptions\HandlingException; |
5 | 4 | use Illuminate\Support\Facades\Http; |
6 | 5 |
|
7 | 6 | $httpRecorder = null; |
|
49 | 48 | expect($parentPage->getTitle())->toBe('Resolve Endpoint - Testing Suite'); |
50 | 49 | }); |
51 | 50 |
|
52 | | -it('should resolve the database parent of a page', function(){ |
| 51 | +it('should resolve the database parent of a page', function () { |
53 | 52 | $page = Notion::pages()->find('415d9b6c6e454f42aab2b6e13804cfe9'); |
54 | 53 |
|
55 | 54 | $database = Notion::resolve()->parent($page->getParent()); |
|
58 | 57 | expect($database->getTitle())->toBe('Test Table as Parent'); |
59 | 58 | }); |
60 | 59 |
|
61 | | -it('should resolve the block parent of a block', function(){ |
| 60 | +it('should resolve the block parent of a block', function () { |
62 | 61 | $block = Notion::block('d5f9419b44204c909501b1e2b7569503')->retrieve(); |
63 | 62 |
|
64 | 63 | $parentBlock = Notion::resolve()->parent($block->getParent()); |
|
67 | 66 | expect($parentBlock->getType())->toBe('paragraph'); |
68 | 67 | }); |
69 | 68 |
|
70 | | -it('should resolve the page parent of a block', function(){ |
| 69 | +it('should resolve the page parent of a block', function () { |
71 | 70 | $block = Notion::block('0971ac1a-b6f2-4acc-b706-f5f2ed16ffd6')->retrieve(); |
72 | 71 |
|
73 | 72 | $pageParent = Notion::resolve()->parent($block->getParent()); |
|
76 | 75 | expect($pageParent->getTitle())->toBe('Page for Block Parent Resolve Testing'); |
77 | 76 | }); |
78 | 77 |
|
79 | | -it('should throw a handling exception when unknown parent type', function(){ |
80 | | - expect(fn() => new NotionParent(['object' => 'unknown', 'id' => '1234']))->toThrow('invalid json-array: the given object is not a valid parent'); |
| 78 | +it('should throw a handling exception when unknown parent type', function () { |
| 79 | + expect(fn () => new NotionParent(['object' => 'unknown', 'id' => '1234']))->toThrow('invalid json-array: the given object is not a valid parent'); |
81 | 80 | }); |
82 | 81 |
|
83 | | -it('should resolve the pages of a database relation', function(){ |
| 82 | +it('should resolve the pages of a database relation', function () { |
84 | 83 | $page = Notion::pages()->find('1c56e2ad3d95458c935dae6d57769037'); |
85 | 84 |
|
86 | 85 | $relationPropertyItems = $page->getProperty('Parent Relation Database'); |
|
0 commit comments