diff --git a/src/ContextTypes/ContactPoint.php b/src/ContextTypes/ContactPoint.php index e1eb6b7..bf6274e 100644 --- a/src/ContextTypes/ContactPoint.php +++ b/src/ContextTypes/ContactPoint.php @@ -12,5 +12,6 @@ class ContactPoint extends AbstractContext protected $structure = [ 'telephone' => null, 'contactType' => null, + 'email' => null, ]; } diff --git a/src/ContextTypes/Organization.php b/src/ContextTypes/Organization.php index b23152e..39401a5 100644 --- a/src/ContextTypes/Organization.php +++ b/src/ContextTypes/Organization.php @@ -13,6 +13,7 @@ class Organization extends Thing 'address' => PostalAddress::class, 'logo' => ImageObject::class, 'contactPoint' => ContactPoint::class, + 'email' => null, ]; /** diff --git a/tests/ContextTypes/Organization2ContactsTest.php b/tests/ContextTypes/Organization2ContactsTest.php index fd3d2a9..7858b28 100644 --- a/tests/ContextTypes/Organization2ContactsTest.php +++ b/tests/ContextTypes/Organization2ContactsTest.php @@ -11,6 +11,7 @@ class Organization2ContactsTest extends TestCase protected $attributes = [ 'name' => 'Said Organization', 'url' => 'https://google.com/organization/22', + 'email' => 'info@nomail.com', 'address' => [ 'streetAddress' => '112 Apple St.', 'addressLocality' => 'Hamden', @@ -20,10 +21,12 @@ class Organization2ContactsTest extends TestCase 'logo' => 'https://google.com/thumbnail1.jpg', 'contactPoint' => [ ['@type' => 'contactPoint', + 'email' => 'support@nomail.com', 'telephone' => '18008888888', 'contactType' => 'customer service', ], ['@type' => 'contactPoint', + 'email' => 'sales@nomail.com', 'telephone' => '18009999999', 'contactType' => 'sales', ], @@ -39,11 +42,13 @@ public function shouldHave2ContactsArray() $this->assertEquals([ '@type' => 'ContactPoint', + 'email' => 'support@nomail.com', 'telephone' => '18008888888', 'contactType' => 'customer service', ], $context->getProperty('contactPoint')[0]); $this->assertEquals([ '@type' => 'ContactPoint', + 'email' => 'sales@nomail.com', 'telephone' => '18009999999', 'contactType' => 'sales', ], $context->getProperty('contactPoint')[1]); diff --git a/tests/ContextTypes/OrganizationTest.php b/tests/ContextTypes/OrganizationTest.php index 09d4e07..50d14b9 100644 --- a/tests/ContextTypes/OrganizationTest.php +++ b/tests/ContextTypes/OrganizationTest.php @@ -11,6 +11,7 @@ class OrganizationTest extends TestCase protected $attributes = [ 'name' => 'Said Organization', 'url' => 'https://google.com/organization/22', + 'email' => 'info@nomail.com', 'address' => [ 'streetAddress' => '112 Apple St.', 'addressLocality' => 'Hamden', @@ -19,11 +20,26 @@ class OrganizationTest extends TestCase ], 'logo' => 'https://google.com/thumbnail1.jpg', 'contactPoint' => [ + 'email' => 'support@nomail.com', 'telephone' => '18009999999', 'contactType' => 'customer service', ], ]; + /** + * @test + */ + public function test_should_have_properties() { + + $this->assertPropertyEquals('name', 'Said Organization'); + + $this->assertPropertyEquals('url', 'https://google.com/organization/22'); + + $this->assertPropertyEquals('email', 'info@nomail.com'); + + $this->assertPropertyEquals('logo', 'https://google.com/thumbnail1.jpg'); + } + /** * @test */ @@ -33,6 +49,7 @@ public function shouldHaveContactPointObject() $this->assertEquals([ '@type' => 'ContactPoint', + 'email' => 'support@nomail.com', 'telephone' => '18009999999', 'contactType' => 'customer service', ], $context->getProperty('contactPoint'));