Skip to content

Apply fixes from StyleCI #152

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Jun 9, 2023
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
13 changes: 6 additions & 7 deletions tests/RecordedEndpointResolveTest.php
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
<?php

use FiveamCode\LaravelNotionApi\Entities\NotionParent;
use FiveamCode\LaravelNotionApi\Exceptions\HandlingException;
use Illuminate\Support\Facades\Http;

$httpRecorder = null;
Expand Down Expand Up @@ -49,7 +48,7 @@
expect($parentPage->getTitle())->toBe('Resolve Endpoint - Testing Suite');
});

it('should resolve the database parent of a page', function(){
it('should resolve the database parent of a page', function () {
$page = Notion::pages()->find('415d9b6c6e454f42aab2b6e13804cfe9');

$database = Notion::resolve()->parent($page->getParent());
Expand All @@ -58,7 +57,7 @@
expect($database->getTitle())->toBe('Test Table as Parent');
});

it('should resolve the block parent of a block', function(){
it('should resolve the block parent of a block', function () {
$block = Notion::block('d5f9419b44204c909501b1e2b7569503')->retrieve();

$parentBlock = Notion::resolve()->parent($block->getParent());
Expand All @@ -67,7 +66,7 @@
expect($parentBlock->getType())->toBe('paragraph');
});

it('should resolve the page parent of a block', function(){
it('should resolve the page parent of a block', function () {
$block = Notion::block('0971ac1a-b6f2-4acc-b706-f5f2ed16ffd6')->retrieve();

$pageParent = Notion::resolve()->parent($block->getParent());
Expand All @@ -76,11 +75,11 @@
expect($pageParent->getTitle())->toBe('Page for Block Parent Resolve Testing');
});

it('should throw a handling exception when unknown parent type', function(){
expect(fn() => new NotionParent(['object' => 'unknown', 'id' => '1234']))->toThrow('invalid json-array: the given object is not a valid parent');
it('should throw a handling exception when unknown parent type', function () {
expect(fn () => new NotionParent(['object' => 'unknown', 'id' => '1234']))->toThrow('invalid json-array: the given object is not a valid parent');
});

it('should resolve the pages of a database relation', function(){
it('should resolve the pages of a database relation', function () {
$page = Notion::pages()->find('1c56e2ad3d95458c935dae6d57769037');

$relationPropertyItems = $page->getProperty('Parent Relation Database');
Expand Down