13
13
use FiveamCode \LaravelNotionApi \Entities \Blocks \NumberedListItem ;
14
14
use FiveamCode \LaravelNotionApi \Entities \Blocks \Paragraph ;
15
15
use FiveamCode \LaravelNotionApi \Entities \Blocks \Pdf ;
16
+ use FiveamCode \LaravelNotionApi \Entities \Blocks \Quote ;
16
17
use FiveamCode \LaravelNotionApi \Entities \Blocks \ToDo ;
17
18
use FiveamCode \LaravelNotionApi \Entities \Blocks \Toggle ;
18
19
use FiveamCode \LaravelNotionApi \Entities \Blocks \Video ;
@@ -100,7 +101,7 @@ public function it_returns_block_collection_with_children_as_correct_instances()
100
101
$ blockChildrenCollection = $ blockChildren ->asCollection ();
101
102
$ this ->assertContainsOnly (Block::class, $ blockChildrenCollection );
102
103
$ this ->assertIsIterable ($ blockChildrenCollection );
103
- $ this ->assertCount (13 , $ blockChildrenCollection );
104
+ $ this ->assertCount (14 , $ blockChildrenCollection );
104
105
105
106
// check paragraph
106
107
$ blockChild = $ blockChildrenCollection [0 ];
@@ -201,6 +202,13 @@ public function it_returns_block_collection_with_children_as_correct_instances()
201
202
$ this ->assertEquals ('TestCaption ' , $ blockChild ->getCaption ()->getPlainText ());
202
203
$ this ->assertEquals ('external ' , $ blockChild ->getHostingType ());
203
204
$ this ->assertEquals ('https://notion.so/testpdf.pdf ' , $ blockChild ->getUrl ());
205
+
206
+ // check quote
207
+ $ blockChild = $ blockChildrenCollection [13 ];
208
+ $ this ->assertInstanceOf (Quote::class, $ blockChild );
209
+ $ this ->assertEquals ('quote ' , $ blockChild ->getType ());
210
+ $ this ->assertFalse ($ blockChild ->hasChildren ());
211
+ $ this ->assertEquals ('quote_block ' , $ blockChild ->getContent ()->getPlainText ());
204
212
}
205
213
206
214
/** @test */
@@ -251,6 +259,7 @@ public function it_returns_parent_block_in_which_new_blocks_have_been_successful
251
259
$ file = File::create ('https://images.unsplash.com/photo-1593642533144-3d62aa4783ec?ixlib=rb-1.2.1&q=85&fm=jpg&crop=entropy&cs=srgb ' , 'Testcaption ' );
252
260
$ video = Video::create ('https://www.w3schools.com/html/mov_bbb.mp4 ' , 'TestCaption ' );
253
261
$ pdf = Pdf::create ('https://notion.so/testpdf.pdf ' , 'TestCaption ' );
262
+ $ quote = Quote::create ('New TextBlock ' );
254
263
255
264
$ parentBlock = Notion::block ('1d719dd1-563b-4387-b74f-20da92b827fb ' )->append ($ paragraph );
256
265
$ this ->assertInstanceOf (Block::class, $ parentBlock );
@@ -291,7 +300,10 @@ public function it_returns_parent_block_in_which_new_blocks_have_been_successful
291
300
$ parentBlock = Notion::block ('1d719dd1-563b-4387-b74f-20da92b827fb ' )->append ($ pdf );
292
301
$ this ->assertInstanceOf (Block::class, $ parentBlock );
293
302
294
- $ parentBlock = Notion::block ('1d719dd1-563b-4387-b74f-20da92b827fb ' )->append ([$ paragraph , $ bulletedListItem , $ headingOne , $ headingTwo , $ headingThree , $ numberedListItem , $ toDo , $ toggle , $ embed , $ image , $ video , $ pdf ]);
303
+ $ parentBlock = Notion::block ('1d719dd1-563b-4387-b74f-20da92b827fb ' )->append ($ quote );
304
+ $ this ->assertInstanceOf (Block::class, $ parentBlock );
305
+
306
+ $ parentBlock = Notion::block ('1d719dd1-563b-4387-b74f-20da92b827fb ' )->append ([$ paragraph , $ bulletedListItem , $ headingOne , $ headingTwo , $ headingThree , $ numberedListItem , $ toDo , $ toggle , $ embed , $ image , $ video , $ pdf , $ quote ]);
295
307
$ this ->assertInstanceOf (Block::class, $ parentBlock );
296
308
}
297
309
@@ -309,6 +321,7 @@ public function classProvider(): array
309
321
[Paragraph::class],
310
322
[ToDo::class],
311
323
[Toggle::class],
324
+ [Quote::class],
312
325
];
313
326
}
314
327
@@ -322,7 +335,7 @@ public function classProvider(): array
322
335
public function it_throws_an_handling_exception_for_wrong_type ($ entityClass )
323
336
{
324
337
$ this ->expectException (HandlingException::class);
325
- $ paragraph = $ entityClass ::create (new \stdClass ());
338
+ $ entityClass ::create (new \stdClass ());
326
339
}
327
340
328
341
/** @test */
0 commit comments