Goose\Tests\Modules\Extractors\PublishDateExtractorTest::getDateFromSchemaOrgProvider PHP Method

getDateFromSchemaOrgProvider() public method

    public function getDateFromSchemaOrgProvider()
    {
        return [[new \DateTime('2016-05-31T22:52:11Z'), $this->document('<html><head><title>Example Article</title><meta itemprop="datePublished" content="2016-05-31T22:52:11Z"></head></html>'), 'Valid date with tag: <meta> and attribute: "content"'], [new \DateTime('2016-05-31T22:52:11Z'), $this->document('<html><head><title>Example Article</title><meta itemprop="datePublished" datetime="2016-05-31T22:52:11Z"></head></html>'), 'Valid date with tag: <meta> and attribute: "datetime"'], [new \DateTime('2016-05-31T22:52:11Z'), $this->document('<html><head><title>Example Article</title></head><body><article>Content<time itemprop="datePublished" datetime="2016-05-31T22:52:11Z"></article></body></html>'), 'Valid date with tag: <time> and attribute: "datetime"'], [new \DateTime('2016-05-31'), $this->document('<html><head><title>Example Article</title><script type="application/ld+json">{"@context":"http://schema.org","@type":"Article","author":"John Smith","datePublished":"2016-05-31"}</script></head></html>'), 'Valid date with JSON-LD and attribute: "datePublished"'], [null, $this->document('<html><head><title>Example Article</title></head></html>'), 'No date provided'], [null, $this->document('<html><head><title>Example Article</title><meta itemprop="datePublished" datetime="two days ago"></head></html>'), 'Invalid date format provided']];
    }