Skip to content

Commit

Permalink
AN-179 Default remote images to "yes" (#662)
Browse files Browse the repository at this point in the history
* AN-179 Default remote images to "yes"

* AN-179 Fix tests to accommodate new setting for remote images
  • Loading branch information
kevinfodness authored Sep 3, 2019
1 parent 3cc918a commit f6ca734
Show file tree
Hide file tree
Showing 6 changed files with 36 additions and 16 deletions.
2 changes: 1 addition & 1 deletion includes/apple-exporter/class-settings.php
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@ class Settings {
'json_alerts' => 'warn',
'post_types' => array( 'post' ),
'show_metabox' => 'yes',
'use_remote_images' => 'no',
'use_remote_images' => 'yes',
);

/**
Expand Down
41 changes: 30 additions & 11 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 1 addition & 0 deletions readme.txt
Original file line number Diff line number Diff line change
Expand Up @@ -49,6 +49,7 @@ Please visit our [wiki](https://github.com/alleyinteractive/apple-news/wiki) for
= 2.0.0 =
* Enhancement: Adds full support for Gutenberg. If Gutenberg is active for a post, uses a Gutenberg PluginSidebar to house all of the Apple News options rather than a metabox. Also adds support for new HTML generated by Gutenberg, including various embeds.
* Enhancement: Adds support for the isPaid flag to indicate that a post is part of News+ and requires a subscription to view.
* Enhancement: Set the default for Use Remote Images to Yes, as this should be the setting that all publishers use now that Apple News supports remote image URLs.
* Bugfix: Refreshes the nonce after re-authenticating to prevent data loss when Gutenberg is not active. Props to @hrkhal for the fix.

= 1.4.4 =
Expand Down
2 changes: 1 addition & 1 deletion tests/apple-exporter/components/test-class-body.php
Original file line number Diff line number Diff line change
Expand Up @@ -339,7 +339,7 @@ public function testLists() {
$json['components'][1]['components'][2]['role']
);
$this->assertEquals(
'bundle://filename.jpg',
'http://someurl.com/filename.jpg',
$json['components'][1]['components'][2]['URL']
);
$this->assertEquals(
Expand Down
2 changes: 1 addition & 1 deletion tests/apple-exporter/components/test-class-heading.php
Original file line number Diff line number Diff line change
Expand Up @@ -89,7 +89,7 @@ public function testImageSplittingWithLink() {
$this->assertEquals(
array(
'role' => 'photo',
'URL' => 'bundle://example-image.jpg',
'URL' => 'http://example.org/example-image.jpg',
'layout' => 'full-width-image',
),
$json['components'][1]['components'][1]
Expand Down
4 changes: 2 additions & 2 deletions tests/test-class-apple-news.php
Original file line number Diff line number Diff line change
Expand Up @@ -221,7 +221,7 @@ public function testMigrateSettings() {
// Setup.
$apple_news = new Apple_News();
delete_option( $apple_news::$option_name );
update_option( 'use_remote_images', 'yes' );
update_option( 'use_remote_images', 'no' );
$default_settings = $this->settings->all();
$apple_news->migrate_settings();

Expand All @@ -230,7 +230,7 @@ public function testMigrateSettings() {
$this->assertNotEquals( $default_settings, $migrated_settings );

// Ensure the migrated settings match what we expect.
$default_settings['use_remote_images'] = 'yes';
$default_settings['use_remote_images'] = 'no';
$this->assertEquals( $default_settings, $migrated_settings );
}

Expand Down

0 comments on commit f6ca734

Please sign in to comment.