}
foreach ( $this->mMetatags as $tag ) {
- if ( 0 == strcasecmp( 'http:', substr( $tag[0], 0, 5 ) ) ) {
+ if ( strncasecmp( $tag[0], 'http:', 5 ) === 0 ) {
$a = 'http-equiv';
$tag[0] = substr( $tag[0], 5 );
+ } elseif ( strncasecmp( $tag[0], 'og:', 3 ) === 0 ) {
+ $a = 'property';
} else {
$a = 'name';
}
$outputPage->addMeta( 'http:expires', '0' );
$outputPage->addMeta( 'keywords', 'first' );
$outputPage->addMeta( 'keywords', 'second' );
+ $outputPage->addMeta( 'og:title', 'Ta-duh' );
$expected = [
[ 'http:expires', '0' ],
[ 'keywords', 'first' ],
[ 'keywords', 'second' ],
+ [ 'og:title', 'Ta-duh' ],
];
$this->assertSame( $expected, $outputPage->getMetaTags() );
$this->assertContains( '<meta http-equiv="expires" content="0"/>', $links );
$this->assertContains( '<meta name="keywords" content="first"/>', $links );
$this->assertContains( '<meta name="keywords" content="second"/>', $links );
+ $this->assertContains( '<meta property="og:title" content="Ta-duh"/>', $links );
$this->assertArrayNotHasKey( 'meta-robots', $links );
}