-
Notifications
You must be signed in to change notification settings - Fork 385
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #852 from Automattic/add/848-theme-support-canonical
Allow theme support of canonical AMP
- Loading branch information
Showing
11 changed files
with
135 additions
and
12 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,45 @@ | ||
<?php | ||
/** | ||
* Tests for amp.php. | ||
* | ||
* @package AMP | ||
*/ | ||
|
||
/** | ||
* Tests for amp.php. | ||
*/ | ||
class Test_AMP extends WP_UnitTestCase { | ||
|
||
/** | ||
* Tear down and clean up. | ||
*/ | ||
public function tearDown() { | ||
parent::tearDown(); | ||
remove_theme_support( 'amp' ); | ||
} | ||
|
||
/** | ||
* Test amp_is_canonical(). | ||
* | ||
* @covers amp_is_canonical() | ||
*/ | ||
public function test_amp_is_canonical() { | ||
remove_theme_support( 'amp' ); | ||
$this->assertFalse( amp_is_canonical() ); | ||
|
||
add_theme_support( 'amp' ); | ||
$this->assertTrue( amp_is_canonical() ); | ||
|
||
remove_theme_support( 'amp' ); | ||
add_theme_support( 'amp', array( | ||
'template_path' => get_template_directory() . 'amp-templates/', | ||
) ); | ||
$this->assertFalse( amp_is_canonical() ); | ||
|
||
remove_theme_support( 'amp' ); | ||
add_theme_support( 'amp', array( | ||
'custom_prop' => 'something', | ||
) ); | ||
$this->assertTrue( amp_is_canonical() ); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters