Skip to content

Commit

Permalink
Fix styling
Browse files Browse the repository at this point in the history
  • Loading branch information
lacasera authored and actions-user committed May 15, 2021
1 parent 6ea649d commit e0337ec
Show file tree
Hide file tree
Showing 3 changed files with 32 additions and 35 deletions.
1 change: 0 additions & 1 deletion src/Client/NotionClient.php
Original file line number Diff line number Diff line change
Expand Up @@ -100,7 +100,6 @@ public function makeRequest(string $method, string $uri, array $params = [], $he
$this->status = $response->getStatusCode();

return json_decode((string)$response->getBody());

} catch (Exception $exception) {
$this->recordError($exception);
}
Expand Down
49 changes: 24 additions & 25 deletions tests/PagesTest.php
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
<?php
namespace R64\PhpNotion\Tests;

use R64\PhpNotion\Notion;
use R64\PhpNotion\Resources\Types\Page;
use R64\PhpNotion\Tests\mocks\PageResponse;

Expand Down Expand Up @@ -29,18 +28,18 @@ public function it_can_create_a_page()

$payload = [
"parent" => [
"database_id" => "4eb895ed2227406f80bcd4565f304cf4"
"database_id" => "4eb895ed2227406f80bcd4565f304cf4",
],
"properties" => [
"Name" => [
"title" => [
[
"text" => [
"content" => "Test Sample Page Header"
]
]
]
]
"content" => "Test Sample Page Header",
],
],
],
],
],
"children" => [
[
Expand All @@ -51,11 +50,11 @@ public function it_can_create_a_page()
[
"type" => "text",
"text" => [
"content" => "Lacinato kale"
]
]
]
]
"content" => "Lacinato kale",
],
],
],
],
],
[
"object" => "block",
Expand All @@ -67,14 +66,14 @@ public function it_can_create_a_page()
"text" => [
"content" => "Lacinato kale is a variety of kale with a long tradition in Italian cuisine, especially that of Tuscany. It is also known as Tuscan kale, Italian kale, dinosaur kale, kale, flat back kale, palm tree kale, or black Tuscan palm.",
"link" => [
"url" => "https://en.wikipedia.org/wiki/Lacinato_kale"
]
]
]
]
]
]
]
"url" => "https://en.wikipedia.org/wiki/Lacinato_kale",
],
],
],
],
],
],
],
];

$response = $notion->pages()->create($payload);
Expand All @@ -93,11 +92,11 @@ public function it_can_update_a_page()
"title" => [
[
"text" => [
"content" => "Sample Page Header"
]
]
]
]
"content" => "Sample Page Header",
],
],
],
],
],
]);

Expand Down
17 changes: 8 additions & 9 deletions tests/mocks/PageResponse.php
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,7 @@ public function created()
"last_edited_time" => "2021-05-15T10:11:07.557Z",
"parent" => [
"type" => "database_id",
"database_id" => "4eb895ed-2227-406f-80bc-d4565f304cf4"
"database_id" => "4eb895ed-2227-406f-80bc-d4565f304cf4",
],
"archived" => false,
"properties" => [
Expand All @@ -64,23 +64,22 @@ public function created()
"type" => "text",
"text" => [
"content" => "Tuscan Kale",
"link" => null
"link" => null,
],
"annotations" => [
"bold" => false,
"italic" => false,
"strikethrough" => false,
"underline" => false,
"code" => false,
"color" => "default"
"color" => "default",
],
"plain_text" => "Tuscan Kale",
"href" => null
]
]
]
]
"href" => null,
],
],
],
],
]);
}

}

0 comments on commit e0337ec

Please sign in to comment.