Skip to content

Commit

Permalink
Merge pull request #19 from linkwise/feature/website-context
Browse files Browse the repository at this point in the history
Add WebSite context.
  • Loading branch information
Torann authored Feb 16, 2017
2 parents 2475e68 + 7102f53 commit 363e11f
Show file tree
Hide file tree
Showing 2 changed files with 54 additions and 0 deletions.
21 changes: 21 additions & 0 deletions src/ContextTypes/WebSite.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
<?php

namespace JsonLd\ContextTypes;

class WebSite extends AbstractContext
{
/**
* Property structure
*
* @var array
*/
protected $structure = [
'about' => null,
'headline' => null,
'image' => null,
'name' => null,
'url' => null,
'keywords' => null,
'sameAs' => null,
];
}
33 changes: 33 additions & 0 deletions tests/ContextTypes/WebSiteTest.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
<?php

namespace JsonLd\Test\ContextTypes;

use JsonLd\Test\TestCase;

class WebSiteTest extends TestCase
{
protected $class = \JsonLd\ContextTypes\WebSite::class;

protected $attributes = [
'about' => 'The subject matter of the content.',
'headline' => 'Headline of the article.',
'image' => 'https://og.github.com/mark/[email protected]',
'name' => 'The name of the item.',
'url' => 'https://schema.org/WebSite',
'keywords' => 'about,headline,image,name,url',
'sameAs' => 'https://schema.org/sameAs',
];

/**
* @test
*/
public function shouldGetProperties()
{
$context = $this->make();

$this->assertEquals(array_merge([
'@context' => 'http://schema.org',
'@type' => 'WebSite',
], $this->attributes), $context->getProperties());
}
}

0 comments on commit 363e11f

Please sign in to comment.