-
Notifications
You must be signed in to change notification settings - Fork 60
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #51 from madman-81/organistaion_multiple_contacts
Allow an Organisation to have multiple ContactPoints
- Loading branch information
Showing
3 changed files
with
88 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,51 @@ | ||
<?php | ||
|
||
namespace JsonLd\Test\ContextTypes; | ||
|
||
use JsonLd\Test\TestCase; | ||
|
||
class Organization2ContactsTest extends TestCase | ||
{ | ||
protected $class = \JsonLd\ContextTypes\Organization::class; | ||
|
||
protected $attributes = [ | ||
'name' => 'Said Organization', | ||
'url' => 'https://google.com/organization/22', | ||
'address' => [ | ||
'streetAddress' => '112 Apple St.', | ||
'addressLocality' => 'Hamden', | ||
'addressRegion' => 'CT', | ||
'postalCode' => '06514', | ||
], | ||
'logo' => 'https://google.com/thumbnail1.jpg', | ||
'contactPoint' => [ | ||
['@type' => 'contactPoint', | ||
'telephone' => '18008888888', | ||
'contactType' => 'customer service', | ||
], | ||
['@type' => 'contactPoint', | ||
'telephone' => '18009999999', | ||
'contactType' => 'sales', | ||
], | ||
], | ||
]; | ||
|
||
/** | ||
* @test | ||
*/ | ||
public function shouldHave2ContactsArray() | ||
{ | ||
$context = $this->make(); | ||
|
||
$this->assertEquals([ | ||
'@type' => 'ContactPoint', | ||
'telephone' => '18008888888', | ||
'contactType' => 'customer service', | ||
], $context->getProperty('contactPoint')[0]); | ||
$this->assertEquals([ | ||
'@type' => 'ContactPoint', | ||
'telephone' => '18009999999', | ||
'contactType' => 'sales', | ||
], $context->getProperty('contactPoint')[1]); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters