{"action":"created","comment":{"url":"https://api.github.com/repos/bbc/programmes-frontend/pulls/comments/174109087","pull_request_review_id":103401560,"id":174109087,"diff_hunk":"@@ -0,0 +1,292 @@\n+<?php\n+declare(strict_types = 1);\n+\n+namespace Tests\\App\\Controller\\Helpers;\n+\n+use App\\Builders\\BroadcastBuilder;\n+use App\\Builders\\CollapsedBroadcastBuilder;\n+use App\\Builders\\EpisodeBuilder;\n+use App\\Builders\\SeriesBuilder;\n+use App\\Builders\\ServiceBuilder;\n+use App\\Controller\\Helpers\\SchemaHelper;\n+use App\\Controller\\Helpers\\StructuredDataHelper;\n+use PHPUnit\\Framework\\TestCase;\n+use Symfony\\Component\\Routing\\Generator\\UrlGeneratorInterface;\n+use App\\Builders\\MasterBrandBuilder;\n+\n+/**\n+ * @group seo_schema\n+ */\n+class StructuredDataHelperTest extends TestCase\n+{\n+    /**\n+     *\n+     * [x] - Basic braodcasts and collapsedBroadcasts has correct info\n+     *\n+     */\n+    public function testOnDemandEpisodeIncludeCorrectFields()\n+    {\n+        $onDemandEpisode = EpisodeBuilder::any()->build();\n+\n+        $ondemandSchema = $this->helper()->getSchemaForOnDemand($onDemandEpisode);\n+\n+        $this->assertKeys([\n+            '@type',\n+            'publishedOn',\n+            'duration',\n+            'url',\n+        ], $ondemandSchema);\n+\n+        $this->assertEquals('OnDemandEvent', $ondemandSchema['@type']);\n+        $this->assertInternalType('array', $ondemandSchema['publishedOn']);\n+    }\n+\n+    public function testPublishedOnContent()\n+    {\n+        $onDemandEpisode = EpisodeBuilder::any()->build();\n+\n+        $publishedOnSchema = $this->helper()->getSchemaForOnDemand($onDemandEpisode)['publishedOn'];\n+\n+        $this->assertKeys([\n+            '@type',\n+            'broadcaster',\n+            'name',\n+        ], $publishedOnSchema);\n+\n+        $this->assertEquals('BroadcastService', $publishedOnSchema['@type']);\n+        $this->assertInternalType('array', $publishedOnSchema['broadcaster']);\n+    }\n+\n+    public function testBroadcasterHasTheRightContent()\n+    {\n+        $onDemandEpisode = EpisodeBuilder::any()->build();\n+\n+        $broadcasterSchema = $this->helper()->getSchemaForOnDemand($onDemandEpisode)['publishedOn']['broadcaster'];\n+\n+        $this->assertKeys([\n+            '@type',\n+            'legalName',\n+            'logo',\n+            'name',\n+            'url',\n+        ], $broadcasterSchema);\n+\n+        $this->assertEquals('Organization', $broadcasterSchema['@type']);\n+    }\n+\n+    public function testBroadcastAddCorrectFields()\n+    {\n+        $broadcast = BroadcastBuilder::any()->build();\n+\n+        $broadcastSchema = $this->helper()->getSchemaForBroadcast($broadcast);\n+\n+        $this->assertKeys([\n+            '@type',\n+            'startDate',\n+            'endDate',\n+            'publishedOn',\n+        ], $broadcastSchema);\n+\n+        $this->assertEquals('BroadcastEvent', $broadcastSchema['@type']);\n+    }\n+\n+    public function testServiceInPublicationHasCorrectInfo()\n+    {\n+        $broadcast = BroadcastBuilder::any()->build();\n+\n+        $broadcastSchema = $this->helper()->getSchemaForBroadcast($broadcast);\n+\n+        $this->assertKeys([\n+            '@type',\n+            'broadcaster',\n+            'name',\n+        ], $broadcastSchema['publishedOn']);\n+\n+        $this->assertEquals('BroadcastEvent', $broadcastSchema['@type']);\n+    }\n+\n+    /**\n+     *\n+     * [x] - Schema understand the concept of multiple publications for collapsed broadcasts\n+     *\n+     */\n+    public function testCollapsedBroadcastUnderstandWhatIsAPublicationService()\n+    {\n+        $collapsedBroadcast = CollapsedBroadcastBuilder::any()->build();\n+\n+        $collapsedSchema = $this->helper()->getSchemaForCollapsedBroadcast($collapsedBroadcast);\n+\n+        $this->assertKeys([\n+            '@type',\n+            'startDate',\n+            'endDate',\n+            'publishedOn',\n+        ], $collapsedSchema);\n+\n+        $this->assertEquals('BroadcastEvent', $collapsedSchema['@type']);\n+        \n+        $this->assertKeys([0], $collapsedSchema['publishedOn']); // guard assertion\n+        $this->assertInternalType('array', $collapsedSchema['publishedOn'][0]);\n+    }\n+\n+    public function testCollapsedBroadcastUnderstandWhatAreMultiplePublicationsServices()\n+    {\n+        $collapsedBroadcast = CollapsedBroadcastBuilder::any()->with([\n+            'services' => [\n+                $service1 = ServiceBuilder::any()->build(),\n+                $service2 = ServiceBuilder::any()->build(),\n+            ],\n+        ])->build();\n+\n+        $publishedOnSchema = $this->helper()->getSchemaForCollapsedBroadcast($collapsedBroadcast)['publishedOn'];\n+\n+        $this->assertCount(2, $publishedOnSchema);\n+\n+        $this->assertKeys([0, 1], $publishedOnSchema); // guard assertion\n+        $this->assertInternalType('array', $publishedOnSchema[0]);\n+        $this->assertInternalType('array', $publishedOnSchema[1]);\n+    }\n+\n+    /**\n+     *\n+     * [x] - Understand the concept of tlec\n+     *\n+     */\n+    public function testUnderstandTheConceptOfTlec()\n+    {\n+        $seriesGrandPa = SeriesBuilder::any()->build();\n+        $seriesFather = SeriesBuilder::any()->with(['parent' => $seriesGrandPa])->build();\n+        $series = SeriesBuilder::any()->with(['parent' => $seriesFather])->build();\n+\n+        $this->assertTrue($seriesGrandPa->isTlec());\n+        $this->assertFalse($seriesFather->isTlec());\n+        $this->assertFalse($series->isTlec());\n+    }\n+\n+    public function testTlecProgrammesHasRightInformation()\n+    {\n+        $series = SeriesBuilder::any()->with([\n+            'masterBrand' => MasterBrandBuilder::anyRadioMasterBrand()->build(),\n+        ])->build();\n+\n+        $containerSchema = $this->helper()->getSchemaForProgrammeContainer($series);\n+\n+        $this->assertKeys([\n+            '@type',\n+            'image',\n+            'description',\n+            'identifier',\n+            'name',\n+            'url',\n+        ], $containerSchema);\n+\n+        $this->assertEquals('RadioSeries', $containerSchema['@type']);\n+    }\n+\n+    public function testEmptyArrayIsReturnedForContainerNotTlec()","path":"tests/Controller/Helpers/StructuredDataHelperTest.php","position":186,"original_position":186,"commit_id":"275dd6004154e07b10302bcb331c068650056673","original_commit_id":"275dd6004154e07b10302bcb331c068650056673","user":{"login":"votemike","id":3957065,"avatar_url":"https://avatars3.githubusercontent.com/u/3957065?v=4","gravatar_id":"","url":"https://api.github.com/users/votemike","html_url":"https://github.com/votemike","followers_url":"https://api.github.com/users/votemike/followers","following_url":"https://api.github.com/users/votemike/following{/other_user}","gists_url":"https://api.github.com/users/votemike/gists{/gist_id}","starred_url":"https://api.github.com/users/votemike/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/votemike/subscriptions","organizations_url":"https://api.github.com/users/votemike/orgs","repos_url":"https://api.github.com/users/votemike/repos","events_url":"https://api.github.com/users/votemike/events{/privacy}","received_events_url":"https://api.github.com/users/votemike/received_events","type":"User","site_admin":false},"body":"I don't think this needs a test. It's unimplemented functionality. We don't want to break tests when we come to implement it.","created_at":"2018-03-13T12:23:19Z","updated_at":"2018-03-13T12:25:06Z","html_url":"https://github.com/bbc/programmes-frontend/pull/465#discussion_r174109087","pull_request_url":"https://api.github.com/repos/bbc/programmes-frontend/pulls/465","author_association":"CONTRIBUTOR","_links":{"self":{"href":"https://api.github.com/repos/bbc/programmes-frontend/pulls/comments/174109087"},"html":{"href":"https://github.com/bbc/programmes-frontend/pull/465#discussion_r174109087"},"pull_request":{"href":"https://api.github.com/repos/bbc/programmes-frontend/pulls/465"}}},"pull_request":{"url":"https://api.github.com/repos/bbc/programmes-frontend/pulls/465","id":174354140,"html_url":"https://github.com/bbc/programmes-frontend/pull/465","diff_url":"https://github.com/bbc/programmes-frontend/pull/465.diff","patch_url":"https://github.com/bbc/programmes-frontend/pull/465.patch","issue_url":"https://api.github.com/repos/bbc/programmes-frontend/issues/465","number":465,"state":"open","locked":false,"title":"Sd renaming","user":{"login":"tatitati","id":2141032,"avatar_url":"https://avatars0.githubusercontent.com/u/2141032?v=4","gravatar_id":"","url":"https://api.github.com/users/tatitati","html_url":"https://github.com/tatitati","followers_url":"https://api.github.com/users/tatitati/followers","following_url":"https://api.github.com/users/tatitati/following{/other_user}","gists_url":"https://api.github.com/users/tatitati/gists{/gist_id}","starred_url":"https://api.github.com/users/tatitati/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/tatitati/subscriptions","organizations_url":"https://api.github.com/users/tatitati/orgs","repos_url":"https://api.github.com/users/tatitati/repos","events_url":"https://api.github.com/users/tatitati/events{/privacy}","received_events_url":"https://api.github.com/users/tatitati/received_events","type":"User","site_admin":false},"body":"","created_at":"2018-03-12T12:33:44Z","updated_at":"2018-03-13T12:25:06Z","closed_at":null,"merged_at":null,"merge_commit_sha":"8d148415e66b789ade30c4c7cb68e2453d7f9a35","assignee":null,"assignees":[],"requested_reviewers":[],"requested_teams":[],"labels":[],"milestone":null,"commits_url":"https://api.github.com/repos/bbc/programmes-frontend/pulls/465/commits","review_comments_url":"https://api.github.com/repos/bbc/programmes-frontend/pulls/465/comments","review_comment_url":"https://api.github.com/repos/bbc/programmes-frontend/pulls/comments{/number}","comments_url":"https://api.github.com/repos/bbc/programmes-frontend/issues/465/comments","statuses_url":"https://api.github.com/repos/bbc/programmes-frontend/statuses/275dd6004154e07b10302bcb331c068650056673","head":{"label":"bbc:sd-renaming","ref":"sd-renaming","sha":"275dd6004154e07b10302bcb331c068650056673","user":{"login":"bbc","id":828722,"avatar_url":"https://avatars1.githubusercontent.com/u/828722?v=4","gravatar_id":"","url":"https://api.github.com/users/bbc","html_url":"https://github.com/bbc","followers_url":"https://api.github.com/users/bbc/followers","following_url":"https://api.github.com/users/bbc/following{/other_user}","gists_url":"https://api.github.com/users/bbc/gists{/gist_id}","starred_url":"https://api.github.com/users/bbc/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/bbc/subscriptions","organizations_url":"https://api.github.com/users/bbc/orgs","repos_url":"https://api.github.com/users/bbc/repos","events_url":"https://api.github.com/users/bbc/events{/privacy}","received_events_url":"https://api.github.com/users/bbc/received_events","type":"Organization","site_admin":false},"repo":{"id":85298889,"name":"programmes-frontend","full_name":"bbc/programmes-frontend","owner":{"login":"bbc","id":828722,"avatar_url":"https://avatars1.githubusercontent.com/u/828722?v=4","gravatar_id":"","url":"https://api.github.com/users/bbc","html_url":"https://github.com/bbc","followers_url":"https://api.github.com/users/bbc/followers","following_url":"https://api.github.com/users/bbc/following{/other_user}","gists_url":"https://api.github.com/users/bbc/gists{/gist_id}","starred_url":"https://api.github.com/users/bbc/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/bbc/subscriptions","organizations_url":"https://api.github.com/users/bbc/orgs","repos_url":"https://api.github.com/users/bbc/repos","events_url":"https://api.github.com/users/bbc/events{/privacy}","received_events_url":"https://api.github.com/users/bbc/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/bbc/programmes-frontend","description":"The new frontend for bbc.co.uk/programmes","fork":false,"url":"https://api.github.com/repos/bbc/programmes-frontend","forks_url":"https://api.github.com/repos/bbc/programmes-frontend/forks","keys_url":"https://api.github.com/repos/bbc/programmes-frontend/keys{/key_id}","collaborators_url":"https://api.github.com/repos/bbc/programmes-frontend/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/bbc/programmes-frontend/teams","hooks_url":"https://api.github.com/repos/bbc/programmes-frontend/hooks","issue_events_url":"https://api.github.com/repos/bbc/programmes-frontend/issues/events{/number}","events_url":"https://api.github.com/repos/bbc/programmes-frontend/events","assignees_url":"https://api.github.com/repos/bbc/programmes-frontend/assignees{/user}","branches_url":"https://api.github.com/repos/bbc/programmes-frontend/branches{/branch}","tags_url":"https://api.github.com/repos/bbc/programmes-frontend/tags","blobs_url":"https://api.github.com/repos/bbc/programmes-frontend/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/bbc/programmes-frontend/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/bbc/programmes-frontend/git/refs{/sha}","trees_url":"https://api.github.com/repos/bbc/programmes-frontend/git/trees{/sha}","statuses_url":"https://api.github.com/repos/bbc/programmes-frontend/statuses/{sha}","languages_url":"https://api.github.com/repos/bbc/programmes-frontend/languages","stargazers_url":"https://api.github.com/repos/bbc/programmes-frontend/stargazers","contributors_url":"https://api.github.com/repos/bbc/programmes-frontend/contributors","subscribers_url":"https://api.github.com/repos/bbc/programmes-frontend/subscribers","subscription_url":"https://api.github.com/repos/bbc/programmes-frontend/subscription","commits_url":"https://api.github.com/repos/bbc/programmes-frontend/commits{/sha}","git_commits_url":"https://api.github.com/repos/bbc/programmes-frontend/git/commits{/sha}","comments_url":"https://api.github.com/repos/bbc/programmes-frontend/comments{/number}","issue_comment_url":"https://api.github.com/repos/bbc/programmes-frontend/issues/comments{/number}","contents_url":"https://api.github.com/repos/bbc/programmes-frontend/contents/{+path}","compare_url":"https://api.github.com/repos/bbc/programmes-frontend/compare/{base}...{head}","merges_url":"https://api.github.com/repos/bbc/programmes-frontend/merges","archive_url":"https://api.github.com/repos/bbc/programmes-frontend/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/bbc/programmes-frontend/downloads","issues_url":"https://api.github.com/repos/bbc/programmes-frontend/issues{/number}","pulls_url":"https://api.github.com/repos/bbc/programmes-frontend/pulls{/number}","milestones_url":"https://api.github.com/repos/bbc/programmes-frontend/milestones{/number}","notifications_url":"https://api.github.com/repos/bbc/programmes-frontend/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/bbc/programmes-frontend/labels{/name}","releases_url":"https://api.github.com/repos/bbc/programmes-frontend/releases{/id}","deployments_url":"https://api.github.com/repos/bbc/programmes-frontend/deployments","created_at":"2017-03-17T10:19:20Z","updated_at":"2018-03-12T13:37:29Z","pushed_at":"2018-03-13T11:51:12Z","git_url":"git://github.com/bbc/programmes-frontend.git","ssh_url":"git@github.com:bbc/programmes-frontend.git","clone_url":"https://github.com/bbc/programmes-frontend.git","svn_url":"https://github.com/bbc/programmes-frontend","homepage":"","size":2682,"stargazers_count":12,"watchers_count":12,"language":"PHP","has_issues":true,"has_projects":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":3,"mirror_url":null,"archived":false,"open_issues_count":7,"license":{"key":"apache-2.0","name":"Apache License 2.0","spdx_id":"Apache-2.0","url":"https://api.github.com/licenses/apache-2.0"},"forks":3,"open_issues":7,"watchers":12,"default_branch":"develop"}},"base":{"label":"bbc:develop","ref":"develop","sha":"eef602bb4fa107665a7283837903d94a4d25be48","user":{"login":"bbc","id":828722,"avatar_url":"https://avatars1.githubusercontent.com/u/828722?v=4","gravatar_id":"","url":"https://api.github.com/users/bbc","html_url":"https://github.com/bbc","followers_url":"https://api.github.com/users/bbc/followers","following_url":"https://api.github.com/users/bbc/following{/other_user}","gists_url":"https://api.github.com/users/bbc/gists{/gist_id}","starred_url":"https://api.github.com/users/bbc/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/bbc/subscriptions","organizations_url":"https://api.github.com/users/bbc/orgs","repos_url":"https://api.github.com/users/bbc/repos","events_url":"https://api.github.com/users/bbc/events{/privacy}","received_events_url":"https://api.github.com/users/bbc/received_events","type":"Organization","site_admin":false},"repo":{"id":85298889,"name":"programmes-frontend","full_name":"bbc/programmes-frontend","owner":{"login":"bbc","id":828722,"avatar_url":"https://avatars1.githubusercontent.com/u/828722?v=4","gravatar_id":"","url":"https://api.github.com/users/bbc","html_url":"https://github.com/bbc","followers_url":"https://api.github.com/users/bbc/followers","following_url":"https://api.github.com/users/bbc/following{/other_user}","gists_url":"https://api.github.com/users/bbc/gists{/gist_id}","starred_url":"https://api.github.com/users/bbc/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/bbc/subscriptions","organizations_url":"https://api.github.com/users/bbc/orgs","repos_url":"https://api.github.com/users/bbc/repos","events_url":"https://api.github.com/users/bbc/events{/privacy}","received_events_url":"https://api.github.com/users/bbc/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/bbc/programmes-frontend","description":"The new frontend for bbc.co.uk/programmes","fork":false,"url":"https://api.github.com/repos/bbc/programmes-frontend","forks_url":"https://api.github.com/repos/bbc/programmes-frontend/forks","keys_url":"https://api.github.com/repos/bbc/programmes-frontend/keys{/key_id}","collaborators_url":"https://api.github.com/repos/bbc/programmes-frontend/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/bbc/programmes-frontend/teams","hooks_url":"https://api.github.com/repos/bbc/programmes-frontend/hooks","issue_events_url":"https://api.github.com/repos/bbc/programmes-frontend/issues/events{/number}","events_url":"https://api.github.com/repos/bbc/programmes-frontend/events","assignees_url":"https://api.github.com/repos/bbc/programmes-frontend/assignees{/user}","branches_url":"https://api.github.com/repos/bbc/programmes-frontend/branches{/branch}","tags_url":"https://api.github.com/repos/bbc/programmes-frontend/tags","blobs_url":"https://api.github.com/repos/bbc/programmes-frontend/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/bbc/programmes-frontend/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/bbc/programmes-frontend/git/refs{/sha}","trees_url":"https://api.github.com/repos/bbc/programmes-frontend/git/trees{/sha}","statuses_url":"https://api.github.com/repos/bbc/programmes-frontend/statuses/{sha}","languages_url":"https://api.github.com/repos/bbc/programmes-frontend/languages","stargazers_url":"https://api.github.com/repos/bbc/programmes-frontend/stargazers","contributors_url":"https://api.github.com/repos/bbc/programmes-frontend/contributors","subscribers_url":"https://api.github.com/repos/bbc/programmes-frontend/subscribers","subscription_url":"https://api.github.com/repos/bbc/programmes-frontend/subscription","commits_url":"https://api.github.com/repos/bbc/programmes-frontend/commits{/sha}","git_commits_url":"https://api.github.com/repos/bbc/programmes-frontend/git/commits{/sha}","comments_url":"https://api.github.com/repos/bbc/programmes-frontend/comments{/number}","issue_comment_url":"https://api.github.com/repos/bbc/programmes-frontend/issues/comments{/number}","contents_url":"https://api.github.com/repos/bbc/programmes-frontend/contents/{+path}","compare_url":"https://api.github.com/repos/bbc/programmes-frontend/compare/{base}...{head}","merges_url":"https://api.github.com/repos/bbc/programmes-frontend/merges","archive_url":"https://api.github.com/repos/bbc/programmes-frontend/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/bbc/programmes-frontend/downloads","issues_url":"https://api.github.com/repos/bbc/programmes-frontend/issues{/number}","pulls_url":"https://api.github.com/repos/bbc/programmes-frontend/pulls{/number}","milestones_url":"https://api.github.com/repos/bbc/programmes-frontend/milestones{/number}","notifications_url":"https://api.github.com/repos/bbc/programmes-frontend/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/bbc/programmes-frontend/labels{/name}","releases_url":"https://api.github.com/repos/bbc/programmes-frontend/releases{/id}","deployments_url":"https://api.github.com/repos/bbc/programmes-frontend/deployments","created_at":"2017-03-17T10:19:20Z","updated_at":"2018-03-12T13:37:29Z","pushed_at":"2018-03-13T11:51:12Z","git_url":"git://github.com/bbc/programmes-frontend.git","ssh_url":"git@github.com:bbc/programmes-frontend.git","clone_url":"https://github.com/bbc/programmes-frontend.git","svn_url":"https://github.com/bbc/programmes-frontend","homepage":"","size":2682,"stargazers_count":12,"watchers_count":12,"language":"PHP","has_issues":true,"has_projects":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":3,"mirror_url":null,"archived":false,"open_issues_count":7,"license":{"key":"apache-2.0","name":"Apache License 2.0","spdx_id":"Apache-2.0","url":"https://api.github.com/licenses/apache-2.0"},"forks":3,"open_issues":7,"watchers":12,"default_branch":"develop"}},"_links":{"self":{"href":"https://api.github.com/repos/bbc/programmes-frontend/pulls/465"},"html":{"href":"https://github.com/bbc/programmes-frontend/pull/465"},"issue":{"href":"https://api.github.com/repos/bbc/programmes-frontend/issues/465"},"comments":{"href":"https://api.github.com/repos/bbc/programmes-frontend/issues/465/comments"},"review_comments":{"href":"https://api.github.com/repos/bbc/programmes-frontend/pulls/465/comments"},"review_comment":{"href":"https://api.github.com/repos/bbc/programmes-frontend/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/bbc/programmes-frontend/pulls/465/commits"},"statuses":{"href":"https://api.github.com/repos/bbc/programmes-frontend/statuses/275dd6004154e07b10302bcb331c068650056673"}},"author_association":"CONTRIBUTOR"}}
{"actor":{"display_login":"votemike"}}