View Issue Details

IDProjectCategoryView StatusLast Update
0003382Composr testing platform / automation goals[All Projects] General / Uncategorisedpublic2018-01-23 01:03
ReporterChris GrahamAssigned ToChris Graham 
SeverityFeature-request 
Status closedResolutionsuspended 
Summary0003382: Unit tests for schema.org
DescriptionRun template previews for the following through a schema.org validator...

Home page (WebPage)
Author (ProfilePage)
Member view (ProfilePage)
Feedback page (ContactPage)
Calendar block in listing mode (Event)
Calendar screen (Event)
Catalogue entry view (ItemPage)
Catalogue entry view [shopping] (Offer)
Download view (ItemPage)
Shopping cart (CheckoutPage)
Image screen (Image)
Video screen (Video)
Gallery flow-mode screen for image (Gallery & Image)
Gallery flow-mode screen for video (Gallery & Video)
Gallery thumb screen (Gallery)
News screen (NewsArticle)
News screen for blog post (BlogPosting)
Comment topic post with review (Review)
Rating box (AggregateRating)
Search results (SearchResultsPage)
New support ticket (ContactPage)
IOTD screen (ImageObject)

Update the maintenance spreadsheet to reflect standard_schema_org is now unit-tested.
TagsGood for training
Time estimation (hours)
Sponsorship open

Activities

Chris Graham

2018-01-20 22:13

administrator   ~0005387

I wrote this test code...

<?php /*

 Composr
 Copyright (c) ocProducts, 2004-2016

 See text/EN/licence.txt for full licencing information.

*/

/**
 * @license http://opensource.org/licenses/cpal_1.0 Common Public Attribution License
 * @copyright ocProducts Ltd
 * @package testing_platform
 */

/**
 * Composr test case class (unit testing).
 */
class schemadotorg_test_set extends cms_test_case
{
    public function setUp()
    {
        require_code('lorem');

        parent::setUp();
    }

    public function testScreens()
    {
        $tpl = render_screen_preview('AUTHOR_SCREEN.tpl', 'authors', 'tpl_preview__author_screen');
        $this->do_validation($tpl->evaluate());
    }

    protected function do_validation($data)
    {
        $url = 'https://search.google.com/structured-data/testing-tool/u/0/validate';
        $post_params = array('html' => $data);
        $result = http_download_file($url, null, true, false, 'Composr', $post_params);
    }

    public function tearDown()
    {
        parent::tearDown();
    }
}

... but I can't find a validator we can easily use as an API. Google's returns a load of JavaScript.

Issue History

Date Modified Username Field Change
2017-11-26 17:54 Chris Graham New Issue
2017-11-26 17:54 Chris Graham Description Updated View Revisions
2017-11-26 17:55 Chris Graham Tag Attached: Can implement during live chat
2018-01-20 22:13 Chris Graham Note Added: 0005387
2018-01-23 01:03 Chris Graham Status non-assigned => closed
2018-01-23 01:03 Chris Graham Assigned To => Chris Graham
2018-01-23 01:03 Chris Graham Resolution open => suspended
2019-06-27 19:42 Chris Graham Tag Renamed Can implement during live chat => Good for training
2023-02-26 18:29 Chris Graham Category General => General / Uncategorised