diff --git a/tests/Unit/Blocks/BulletedListItemTest.php b/tests/Unit/Blocks/BulletedListItemTest.php index d58e570d..751c8d8f 100644 --- a/tests/Unit/Blocks/BulletedListItemTest.php +++ b/tests/Unit/Blocks/BulletedListItemTest.php @@ -2,6 +2,7 @@ namespace Notion\Test\Unit\Blocks; +use Notion\Blocks\BlockFactory; use Notion\Blocks\BulletedListItem; use Notion\Common\Date; use Notion\Common\RichText; @@ -81,6 +82,8 @@ public function test_create_from_array(): void $this->assertEmpty($item->children()); $this->assertEquals("Notion items rock!", $item->toString()); $this->assertFalse($item->block()->archived()); + + $this->assertEquals($item, BlockFactory::fromArray($array)); } public function test_error_on_wrong_type(): void diff --git a/tests/Unit/Blocks/CalloutTest.php b/tests/Unit/Blocks/CalloutTest.php index dbfa207c..077042fc 100644 --- a/tests/Unit/Blocks/CalloutTest.php +++ b/tests/Unit/Blocks/CalloutTest.php @@ -2,6 +2,7 @@ namespace Notion\Test\Unit\Blocks; +use Notion\Blocks\BlockFactory; use Notion\Blocks\Callout; use Notion\Common\Date; use Notion\Common\Emoji; @@ -87,6 +88,8 @@ public function test_create_from_array_with_emoji_icon(): void $this->assertEquals("Notion callouts rock!", $callout->toString()); $this->assertEquals("☀️", $callout->icon()->emoji()); $this->assertFalse($callout->block()->archived()); + + $this->assertEquals($callout, BlockFactory::fromArray($array)); } public function test_create_from_array_with_icon_file(): void diff --git a/tests/Unit/Blocks/CodeTest.php b/tests/Unit/Blocks/CodeTest.php index e4877968..7af96e58 100644 --- a/tests/Unit/Blocks/CodeTest.php +++ b/tests/Unit/Blocks/CodeTest.php @@ -2,6 +2,7 @@ namespace Notion\Test\Unit\Blocks; +use Notion\Blocks\BlockFactory; use Notion\Blocks\Code; use Notion\Common\Date; use Notion\Common\RichText; @@ -55,6 +56,7 @@ public function test_create_from_array(): void $this->assertCount(1, $code->text()); $this->assertEquals("toString()); + $this->assertEquals($code, BlockFactory::fromArray($array)); } public function test_error_on_wrong_type(): void diff --git a/tests/Unit/Blocks/Heading1Test.php b/tests/Unit/Blocks/Heading1Test.php index e0811db8..444054d9 100644 --- a/tests/Unit/Blocks/Heading1Test.php +++ b/tests/Unit/Blocks/Heading1Test.php @@ -2,6 +2,7 @@ namespace Notion\Test\Unit\Blocks; +use Notion\Blocks\BlockFactory; use Notion\Blocks\Heading1; use Notion\Common\Date; use Notion\Common\RichText; @@ -79,6 +80,8 @@ public function test_create_from_array(): void $this->assertCount(2, $heading->text()); $this->assertEquals("Notion headings rock!", $heading->toString()); $this->assertFalse($heading->block()->archived()); + + $this->assertEquals($heading, BlockFactory::fromArray($array)); } public function test_error_on_wrong_type(): void diff --git a/tests/Unit/Blocks/Heading2Test.php b/tests/Unit/Blocks/Heading2Test.php index 505b4c58..8a5ae8d3 100644 --- a/tests/Unit/Blocks/Heading2Test.php +++ b/tests/Unit/Blocks/Heading2Test.php @@ -2,6 +2,7 @@ namespace Notion\Test\Unit\Blocks; +use Notion\Blocks\BlockFactory; use Notion\Blocks\Heading2; use Notion\Common\Date; use Notion\Common\RichText; @@ -79,6 +80,8 @@ public function test_create_from_array(): void $this->assertCount(2, $heading->text()); $this->assertEquals("Notion headings rock!", $heading->toString()); $this->assertFalse($heading->block()->archived()); + + $this->assertEquals($heading, BlockFactory::fromArray($array)); } public function test_error_on_wrong_type(): void diff --git a/tests/Unit/Blocks/Heading3Test.php b/tests/Unit/Blocks/Heading3Test.php index 4ecd9981..bfe541ac 100644 --- a/tests/Unit/Blocks/Heading3Test.php +++ b/tests/Unit/Blocks/Heading3Test.php @@ -2,6 +2,7 @@ namespace Notion\Test\Unit\Blocks; +use Notion\Blocks\BlockFactory; use Notion\Blocks\Heading3; use Notion\Common\Date; use Notion\Common\RichText; @@ -79,6 +80,8 @@ public function test_create_from_array(): void $this->assertCount(2, $heading->text()); $this->assertEquals("Notion headings rock!", $heading->toString()); $this->assertFalse($heading->block()->archived()); + + $this->assertEquals($heading, BlockFactory::fromArray($array)); } public function test_error_on_wrong_type(): void diff --git a/tests/Unit/Blocks/NumberedListItemTest.php b/tests/Unit/Blocks/NumberedListItemTest.php index ae00e99b..32015d71 100644 --- a/tests/Unit/Blocks/NumberedListItemTest.php +++ b/tests/Unit/Blocks/NumberedListItemTest.php @@ -2,6 +2,7 @@ namespace Notion\Test\Unit\Blocks; +use Notion\Blocks\BlockFactory; use Notion\Blocks\NumberedListItem; use Notion\Common\Date; use Notion\Common\RichText; @@ -81,6 +82,8 @@ public function test_create_from_array(): void $this->assertEmpty($item->children()); $this->assertEquals("Notion items rock!", $item->toString()); $this->assertFalse($item->block()->archived()); + + $this->assertEquals($item, BlockFactory::fromArray($array)); } public function test_error_on_wrong_type(): void diff --git a/tests/Unit/Blocks/ParagraphTest.php b/tests/Unit/Blocks/ParagraphTest.php index 3ee6b99f..edb2023b 100644 --- a/tests/Unit/Blocks/ParagraphTest.php +++ b/tests/Unit/Blocks/ParagraphTest.php @@ -2,6 +2,7 @@ namespace Notion\Test\Unit\Blocks; +use Notion\Blocks\BlockFactory; use Notion\Blocks\Paragraph; use Notion\Common\Date; use Notion\Common\RichText; @@ -81,6 +82,8 @@ public function test_create_from_array(): void $this->assertEmpty($paragraph->children()); $this->assertEquals("Notion paragraphs rock!", $paragraph->toString()); $this->assertFalse($paragraph->block()->archived()); + + $this->assertEquals($paragraph, BlockFactory::fromArray($array)); } public function test_error_on_wrong_type(): void diff --git a/tests/Unit/Blocks/QuoteTest.php b/tests/Unit/Blocks/QuoteTest.php index 39d1e927..1cc2da03 100644 --- a/tests/Unit/Blocks/QuoteTest.php +++ b/tests/Unit/Blocks/QuoteTest.php @@ -2,6 +2,7 @@ namespace Notion\Test\Unit\Blocks; +use Notion\Blocks\BlockFactory; use Notion\Blocks\Quote; use Notion\Common\Date; use Notion\Common\RichText; @@ -81,6 +82,8 @@ public function test_create_from_array(): void $this->assertEmpty($quote->children()); $this->assertEquals("Notion quotes rock!", $quote->toString()); $this->assertFalse($quote->block()->archived()); + + $this->assertEquals($quote, BlockFactory::fromArray($array)); } public function test_error_on_wrong_type(): void diff --git a/tests/Unit/Blocks/ToDoTest.php b/tests/Unit/Blocks/ToDoTest.php index 8e87e763..82d20c71 100644 --- a/tests/Unit/Blocks/ToDoTest.php +++ b/tests/Unit/Blocks/ToDoTest.php @@ -2,6 +2,7 @@ namespace Notion\Test\Unit\Blocks; +use Notion\Blocks\BlockFactory; use Notion\Blocks\ToDo; use Notion\Common\Date; use Notion\Common\RichText; @@ -84,6 +85,8 @@ public function test_create_from_array(): void $this->assertEquals("Notion to dos rock!", $toDo->toString()); $this->assertTrue($toDo->checked()); $this->assertFalse($toDo->block()->archived()); + + $this->assertEquals($toDo, BlockFactory::fromArray($array)); } public function test_error_on_wrong_type(): void diff --git a/tests/Unit/Blocks/ToggleTest.php b/tests/Unit/Blocks/ToggleTest.php index 85d04d77..baf27f57 100644 --- a/tests/Unit/Blocks/ToggleTest.php +++ b/tests/Unit/Blocks/ToggleTest.php @@ -2,6 +2,7 @@ namespace Notion\Test\Unit\Blocks; +use Notion\Blocks\BlockFactory; use Notion\Blocks\Toggle; use Notion\Common\Date; use Notion\Common\RichText; @@ -81,6 +82,8 @@ public function test_create_from_array(): void $this->assertEmpty($toggle->children()); $this->assertEquals("Notion toggles rock!", $toggle->toString()); $this->assertFalse($toggle->block()->archived()); + + $this->assertEquals($toggle, BlockFactory::fromArray($array)); } public function test_error_on_wrong_type(): void